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: 8
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: 2022-11-16 17:46 CET (History)
6 users (show)

See Also:
Source RPM: sane-frontends-1.0.14-27.mga8
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

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