Bug 30702 - xscanimage gives segmentation fault
Summary: xscanimage gives segmentation fault
Status: NEW
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 9
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: All Packagers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 30703
Blocks:
  Show dependency treegraph
 
Reported: 2022-08-04 11:14 CEST by Herman Viaene
Modified: 2024-05-30 10:46 CEST (History)
7 users (show)

See Also:
Source RPM: sane-frontends-1.0.14-28.mga9
CVE:
Status comment:


Attachments

Description Herman Viaene 2022-08-04 11:14:26 CEST
Description of problem:
Start xscanimage from the CLI with scanner powered on. You get immediately a segmentation fault

Version-Release number of selected component (if applicable):
Mageia 8 x86-64 Plasma fully updated (official updates) up to today 4/8/2022.

How reproducible:
Each and every time. Has been confirmed by Morgan Leijström.

Steps to Reproduce:
1.
2.
3.
Comment 1 Morgan Leijström 2022-08-04 11:36:31 CEST
Yes confirming.
And as for Herman, xsane still works for me.

My scanner is an Epson Perfection 1660 Photo, Herman have a Epson 2400 Photoscanner an an all-in-one HP-printer-scanner HP Envy 6022.

Without scanner attached it exits with message about that, without segfault.


Found in journal:
svarten.tribun kernel: xscanimage[26936]: segfault at 0 ip 00007f560fe0f07a sp 00007ffd4f0df568 error 4 in libc-2.32.so[7f560fda3000+14f000]

Libc version incompatibility?

No maintainer, assigning to all.

Source RPM: (none) => sane-frontends-1.0.14-27.mga8
Assignee: bugsquad => pkg-bugs
CC: (none) => fri

Comment 2 sturmvogel 2022-08-04 11:43:07 CEST
Does this also happen with scanimage from sane-backends-1.0.31-3.mga8?
Comment 3 Herman Viaene 2022-08-04 11:59:07 CEST
$ scanimage -L
device `epson2:libusb:001:003' is a Epson GT-9300 flatbed scanner

So, no segmentation fault, but it presentq another issue: the HP Envy 6022 is not listed, allthough it shows up in MCC-HW-Scanner. And it used to work OK.
Comment 4 Herman Viaene 2022-08-04 12:02:12 CEST
And there is no HW problem, since the xscanimage works perfectly OK from Fedora 36 on a VM on the same desktop PC.
Comment 5 Morgan Leijström 2022-08-04 12:05:59 CEST
Never used it manually, trying:
[morgan@svarten ~]$ /usr/bin/scanimage --help
...
-L, --list-devices         show available scanner devices
...
-T, --test                 test backend thoroughly


$ /usr/bin/scanimage -L
device `epson2:libusb:003:004' is a Epson GT-8300 flatbed scanner

  (wrong model name but probably compatible)

[morgan@svarten ~]$ /usr/bin/scanimage -T
Output format is not set, using pnm as a default.
scanimage: scanning image of size 208x292 pixels at 1 bits/pixel
scanimage: acquiring gray frame, 1 bits/sample
scanimage: reading one scanline, 26 bytes...    FAIL Error: Error during device I/O

And the scanner lamp started blinking (usually does at scanning and warming up, but it was already ready)

After this the scanner need be power cycled (or maybe only replug it) for xsane to see it, and then xsane works perfectly.
Comment 6 sturmvogel 2022-08-04 12:20:59 CEST
We should maybe consider to update the complete sane stack (maybe in backports) as we are using an antigue version from Aug 2020. In the meantime two new versions where released with several bugfixes for segfaults with different scanner manufacturers. Even in cauldron it seems that we are using a outdated version from over a year ago.
Comment 7 Morgan Leijström 2022-08-04 12:27:30 CEST
Good idea, lets first see if whole stack can be updated.

Bug 30703 - Update the complete sane stack

Depends on: (none) => 30703

Comment 8 Morgan Leijström 2022-08-04 12:34:50 CEST
*** Bug 28405 has been marked as a duplicate of this bug. ***
Comment 9 Dave Hodgins 2022-08-04 16:47:39 CEST
Just fyi, with my Canon, Inc. PIXMA MP150 Scanner, xscanimage is working.

CC: (none) => davidwhodgins

Comment 10 Dave Hodgins 2022-08-04 16:57:29 CEST
One thing I haven't seen mentioned, which seems strange. When I run xscanimage,
I get the popup requesting the password for my user before it runs. After
entering the password, it works.
Comment 11 Morgan Leijström 2022-08-04 17:04:44 CEST
That was strange - I get no popup asking for password.
That said, my user is in wheel group.
Comment 12 Dave Hodgins 2022-08-04 17:10:25 CEST
As is mine. I'd forgotten about the groups.
$ grep -e sane -e scan /etc/group
usb:x:43:saned,ups,dave
cdwriter:x:80:saned,dave
scanner:x:466:dave
saned:x:464:dave

Can anyone experiencing the problem ensure their id is in the scanner and
saned groups?
Comment 13 Herman Viaene 2022-08-04 17:12:48 CEST
Mine isn't, has never been.
Comment 14 Morgan Leijström 2022-08-04 17:13:23 CEST
$ grep -e sane -e scan /etc/group
scanner:x:987:
Comment 15 Herman Viaene 2022-08-04 17:16:18 CEST
And second: I created a "junk" user afresh. It didn't see any scanner. I added it to the scanner group and then it saw the Epson scanner, not the HP, and the xscanimage crashed as well.
Comment 16 Morgan Leijström 2022-08-04 17:23:20 CEST
Added myself to scanner group, logged out, in, still segfaults.
Comment 17 Morgan Leijström 2022-08-04 17:30:39 CEST
There was no saned group in my system... so created it, and joined, logged out-in, but still not better.  Is a system reboot needed?

[morgan@svarten ~]$ grep -e sane -e scan /etc/group
scanner:x:987:morgan
saned:x:988:morgan

[morgan@svarten ~]$ xscanimage
Segmenteringsfel (minnesutskrift skapad)
Comment 18 Dave Hodgins 2022-08-04 17:36:32 CEST
Possibly related packages
$ rpm -qa|grep -e sane -e scan | sort
lib64kf5sane5-20.12.0-1.mga8
lib64sane1-1.0.31-3.mga8
lib64sane-hpaio1-3.22.6-1.mga8
libksane-20.12.0-1.mga8
libsane1-1.0.31-3.mga8
sane-backends-1.0.31-3.mga8
sane-backends-iscan-1.0.31-3.mga8
saned-1.0.31-3.mga8
sane-frontends-1.0.14-27.mga8
simple-scan-3.38.2-1.mga8
sslscan-2.0.6-1.mga8
task-printing-scanning-2018-6.mga8
task-scanning-2011.0-11.mga8
xsane-0.999-14.mga8
xsane-gimp-0.999-14.mga8
Comment 19 Morgan Leijström 2022-08-04 17:40:33 CEST
Added myself to usb group too, no change.
I notice from Comment 12, Dave have a user "saned" that also is member of usb, somewhat logical maybe as the scanner is on USB.  How cone there is a user "saned" and not on my system.

*xsane* work anyway on mine and Hermans systems, but not xscanimage...

--

$ rpm -qa|grep -e sane -e scan | sort
lib64kf5sane5-20.12.0-1.mga8
lib64sane1-1.0.31-3.mga8
lib64sane-hpaio1-3.22.6-1.mga8
libksane-20.12.0-1.mga8
sane-backends-1.0.31-3.mga8
sane-backends-iscan-1.0.31-3.mga8
sane-frontends-1.0.14-27.mga8
simple-scan-3.38.2-1.mga8
xsane-0.999-14.mga8

Will now add up to list per Comment 18...
Comment 20 Morgan Leijström 2022-08-04 17:52:54 CEST
[morgan@svarten ~]$ rpm -qa|grep -e sane -e scan | sort
lib64kf5sane5-20.12.0-1.mga8
lib64sane1-1.0.31-3.mga8
lib64sane-hpaio1-3.22.6-1.mga8
libksane-20.12.0-1.mga8
sane-backends-1.0.31-3.mga8
sane-backends-iscan-1.0.31-3.mga8
saned-1.0.31-3.mga8
sane-frontends-1.0.14-27.mga8
simple-scan-3.38.2-1.mga8
task-printing-scanning-2018-6.mga8
task-scanning-2011.0-11.mga8
xsane-0.999-14.mga8
xsane-gimp-0.999-14.mga8
[morgan@svarten ~]$ 

[morgan@svarten ~]$ grep -e sane -e scan /etc/group
scanner:x:987:morgan
saned:x:988:morgan

Hm, I expected user "saned" should be created when sane installed, but no.

$ xscanimage
Segmenteringsfel (minnesutskrift skapad)
Comment 21 Morgan Leijström 2022-08-04 18:05:32 CEST
(I did reboot after installing packages)
Comment 22 Dave Hodgins 2022-08-04 19:15:21 CEST
# rpm -q --scripts saned|head -n 3
preinstall scriptlet (using /bin/sh):
# Add saned to group scanner, cdwriter and usb for scanner access.
/usr/sbin/useradd -r -M -s /bin/false -d /etc/sane.d -c "system user for saned" saned -G cdwriter,usb,scanner || :
 
So it should have been created when the package saned was installed.
 
Regards, Dave Hodgins
Comment 23 Morgan Leijström 2022-08-04 22:15:49 CEST
Ah, the script probably stumbled because I made the saned group already (Comment 17)  Test:

$ sudo LC_ALL=C /usr/sbin/useradd -r -M -s /bin/false -d /etc/sane.d -c "system user for saned" saned -G cdwriter,usb,scanner || :
useradd: group saned exists - if you want to add this user to that group, use -g.

I urpme sane (and thus task-printing-scanning too), delete group saned, urpmi the two packages back. Result OK:

[morgan@svarten ~]$ grep -e sane -e scan /etc/group
usb:x:43:root,morgan,saned
cdwriter:x:80:saned
scanner:x:987:morgan,saned
saned:x:948:

$ xscanimage
Segmenteringsfel (minnesutskrift skapad)

So still not OK.
Adding myself, to fully replicate Dave in comment 12
Also rebooted the system

[morgan@svarten ~]$ grep -e sane -e scan /etc/group
usb:x:43:root,morgan,saned
cdwriter:x:80:saned,morgan
scanner:x:987:morgan,saned
saned:x:948:morgan

[morgan@svarten ~]$ xscanimage
Segmenteringsfel (minnesutskrift skapad)

And still journal logs "error 4 in libc-2.32.so"
At the same time it segfaults, HPLIP system tray applet shows a warning message (no details)
Comment 24 Dave Hodgins 2022-08-05 01:03:49 CEST
Adding kernel and drivers team to cc list as it's libc that's segfaulting.

CC: (none) => kernel

Comment 25 papoteur 2022-08-05 07:23:05 CEST
For someone using cauldron, is the problem the same?

CC: (none) => yves.brungard_mageia

Comment 26 Herman Viaene 2022-08-05 10:34:21 CEST
It has something to do with the configuration of the system. On the laptop where I test the upcoming updates, xscanimage works perfectly with the wifi-connected HP Envy 6022.
Comment 27 Morgan Leijström 2022-08-05 10:49:24 CEST
@Herman, on the working system, do you get a password dialogue like Dave in Comment 10?
Comment 28 Herman Viaene 2022-08-05 10:55:33 CEST
No. Never seen that before either.
Comment 29 Herman Viaene 2022-08-05 11:27:00 CEST
And forgot to mention: the user on the working system does not belong in any other group besides its own.
Comment 30 Dave Hodgins 2022-08-07 03:34:27 CEST
Figured out why I'm getting polkit requesting my password. It's because I
have avahi-daemon.service stopped and masked. After unmasking and starting it,
I don't get the password prompt. I still don't get a segfault though.
Comment 31 Morgan Leijström 2022-09-19 23:55:12 CEST
Still segfault with sane-1.1.1-2.mga8.src.rpm Bug 30703
Comment 32 Julien Moragny 2022-09-20 19:14:54 CEST
To clarify, xscanimage come from sane-frontends which is more or less abandoned upstream (last release is 17 years old) and had not been updated in bug #30703.

scanimage (without the x) is a cli program which come from sane-backends and had been updated.

regards
julien

CC: (none) => julien.moragny

Comment 33 Morgan Leijström 2022-09-20 19:43:32 CEST
Ah.
Maybe time to drop it in mga9 then?
Comment 34 Julien Moragny 2022-09-20 21:32:15 CEST
That would be my preference, only gscan2pdf depends on sane-frontends and I don't understand why since it works without issue after removing it (with --nodeps); and for the gimp plugin, it can be replaced with xsane-gimp.
Comment 35 Julien Moragny 2022-09-20 21:51:41 CEST
Precision, sane-frontends provide an optional alternate engine (scanadf) for scanning in gscan2pdf (scanimage is also an alternate engine).

gscan2pdf works without sane-frontends, it just doesn't propose scanadf as alternate engine.

The author of gscan2pdf is in the process of deprecating those alternates engines ( https://sourceforge.net/p/gscan2pdf/mailman/message/37200258/ ).
Comment 36 Rolf Pedersen 2022-09-21 00:30:41 CEST
(In reply to Julien Moragny from comment #35)
...
> 
> The author of gscan2pdf is in the process of deprecating those alternates
> engines ( https://sourceforge.net/p/gscan2pdf/mailman/message/37200258/ ).

I use gscan2pdf a lot and notice the author states (2021-01-18):
"So - is there anyone using the scanimage or scanadf frontends in 
gscan2pdf who would have a problem switching to the libsane-image-perl 
frontend?"

I can't find anything `libsane-image-perl` in MGA8, if that is what will be required.

Thanks.

CC: (none) => rolfpedersen

Comment 37 Julien Moragny 2022-09-21 14:51:19 CEST
The package is named perl-Image-Sane in MGA8.


You can see and choose the frontend in the preference.

regards 
julien
Comment 38 Julien Moragny 2022-11-16 17:46:39 CET
Hello,

I just pushed an updated version of sane-frontends (latest git) to cauldron and 8 update_testing.

Can someone with the issue try to see if it is fixed?

There are some commit related to segfaults in the log

regards
Julien
Comment 39 Morgan Leijström 2024-05-28 12:39:05 CEST
What is the status of this?
Comment 40 Herman Viaene 2024-05-28 14:24:04 CEST
M9 fully updated:
The command displays the list of my 2 scanners connected, but no matter which one I take, I get at the CLI:
$ xscanimage 
Segmentationerror (memorydump made)
Morgan Leijström 2024-05-28 14:32:43 CEST

Source RPM: sane-frontends-1.0.14-27.mga8 => sane-frontends-1.0.14-28.mga9
Version: 8 => 9

Comment 41 Morgan Leijström 2024-05-28 14:46:51 CEST
Segfault for me too, while xsane works.
My scanner is an Epson Perfection 1660 Photo, via USB2.

...But it seem to vary; now I tried again and got:

$ /usr/bin/xscanimage
[xscanimage] No scanners were identified. If you were expecting something
          different, check that the scanner is plugged in, turned on and
          detected by sane-find-scanner (if appropriate). Please read
          the documentation which came with this software (README, FAQ,
          manpages).

$ sane-find-scanner
...
found USB scanner (vendor=0x04b8 [EPSON], product=0x011e [EPSON Scanner]) at libusb:002:004
...
  # Your USB scanner was (probably) detected. It may or may not be supported by
  # SANE. Try scanimage -L and read the backend's manpage.

   ( "..." means i cut some lines)

$ scanimage -L
No scanners were identified. If you were expecting something different,
check that the scanner is plugged in, turned on and detected by the
sane-find-scanner tool (if appropriate). Please read the documentation
which came with this software (README, FAQ, manpages).

   (the response took a couple minutes to show)

So on my system sane-find-scanner (and xsane) find the scanner, but xscanimage do not.

I also tried:

$ /usr/bin/scanimage -T
Output format is not set, using pnm as a default.
scanimage: scanning image of size 208x292 pixels at 1 bits/pixel
scanimage: acquiring gray frame, 1 bits/sample
scanimage: reading one scanline, 26 bytes...    FAIL Error: Error during device I/O
Comment 42 Florian Hubold 2024-05-29 22:28:18 CEST
This bug report should probably be split up:

- segmentation fault for an age-old program which is unmaintainted upstream and should be dropped
- permission issues accessing scanners
- varying detection of scanners from different manufactures which use totally different sane backends

What is missing IMHO is whether any of the listed Epson scanners worked normally out of the box on Mageia and if so with what sane version ?

----

It would also be helpful for a particular scanner to at least post the actual PCI vendor/product IDs (lspcidrake -v or lspci -nn) for comparison instead of only the model name and look them up in the sane supported devices list (e.g. for Epson http://www.sane-project.org/sane-mfgs.html#Z-EPSON ) and check what backend should be used.

Then check the backend documentation if maybe some changes to the sane dll.conf or the backend configuration for that model might be necessary because our defaults might be wrong.

CC: (none) => doktor5000

Comment 43 Herman Viaene 2024-05-30 09:09:39 CEST
My Epson Photo 2400 scanner or in American speak GT-9300, has worked out of the box in every Mageia release I care to remember with sane.
The HP is rather recent and works OK under M8 and M9 out of the box as a printer.
Output of 
# lspcidrake -v
.........
usbfs           : HP|ENVY 6000 series [Printer|Printer] (vendor:03f0 device:3454)
scanner         : EPSON|EPSON Scanner (vendor:04b8 device:011b)

The HP is an all-in-one and required some download from HP to work as a scanner.
Comment 44 Morgan Leijström 2024-05-30 10:46:06 CEST
What: old flatbed scanner EPSON PERFECTION 1660 PHOTO, USB2 connection

Mageia9-64 Plasma X11. Nothing but Mageia packages used.

$ lspcidrake -v | grep EPSON
scanner         : EPSON|EPSON Scanner (vendor:04b8 device:011e)

$ sane-find-scanner
...
found USB scanner (vendor=0x04b8 [EPSON], product=0x011e [EPSON Scanner]) at libusb:002:004

$ scanimage -L
device `epson2:libusb:002:005' is a Epson GT-8300 flatbed scanner

§ scanimage -T fail after a couple minutes with "FAIL Error: Error during device I/O"

Works perfectly using xsane, which show "GT-8300:004" in top window frame.

Note You need to log in before you can comment on or make changes to this bug.