Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 815271 - media-gfx/xsane receives "SIGSEGV" signal after "Lampoff-time" has been reached and choosing another scan mode
Summary: media-gfx/xsane receives "SIGSEGV" signal after "Lampoff-time" has been reach...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-28 20:33 UTC by Ramon Fischer
Modified: 2021-10-22 18:25 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Hewlett-Packard:Scanjet2200c.drc (Hewlett-Packard:Scanjet2200c.drc,1.84 KB, application/binary)
2021-09-28 20:36 UTC, Ramon Fischer
Details
xsane configuration (20210928-211026_screenshot.png,297.66 KB, image/png)
2021-09-28 20:38 UTC, Ramon Fischer
Details
Censored strace_xsane (strace_xsane.xz,86.87 KB, application/archive)
2021-09-28 20:44 UTC, Ramon Fischer
Details
plustek.conf (plustek.conf,4.04 KB, text/plain)
2021-09-29 06:09 UTC, Ramon Fischer
Details
xsane_backtrace.log (xsane_backtrace.log,10.51 KB, text/x-log)
2021-10-22 18:25 UTC, Ramon Fischer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ramon Fischer 2021-09-28 20:33:47 UTC
Hello,

after scanning a document, when the "Lampoff-time" has been reached, the lamp will turn off. After choosing another scan mode, "Color" for example, will immediately exit "xsane".

"strace" will show, that the process received a "SIGSEGV" signal:

    --- SIGSEGV {si_signo=SIGSEGV, si_code=SI_KERNEL, si_addr=NULL} ---
    +++ killed by SIGSEGV +++
    [1]    12919 segmentation fault  xsane

I cannot pinpoint this issue any further.

-Ramon

---

This might be related:
HP Scanjet 2200c ("plustek"): Lamp does not turn off after scan process: https://gitlab.com/sane-project/backends/-/issues/515

Reproducible: Always

Steps to Reproduce:
1. Go to a temporary directory: cd "$(mktemp --directory)"
2. Open "xsane" and write "strace" information to "strace_xsane": strace xsane 2>&1 | tee "strace_xsane"
3. Navigate to "Preferences - Load device settings"
4. Load the configuration attached file "Hewlett-Packard:Scanjet2200c.drc"
    3.1. Configure "xsane" like in the attached screenshot
    3.2. Set "Lampoff-time" to "10"
5. Click on the button "Scan" and wait for the end of the scan process.
    4.1. Wait for 10 seconds until the lamp turns off
6. Navigate to "scan mode (Gray)"
7. Choose "Color"
    7.1. "xsane" should immediately close.
8. Analyse the file "strace_xsane"

Actual Results:  
"xsane" closes immediately.

Expected Results:  
The scan mode "Color" is chosen successfully.

Client:
$ xsane --version
xsane-0.999 (c) 1998-2013 Oliver Rauch

This package is modified from the original version.
Please contact your vendor or report problems at
http://bugs.gentoo.org

  E-mail: Oliver.Rauch@xsane.org
  package xsane-0.999
  compiled with GTK-2.24.33
  with color management function
  with GIMP support, compiled with GIMP-2.10.22
  XSane output formats: jpeg, pdf(compr.), png, pnm, ps(compr.), tiff, txt

$ eix --installed sane
[I] acct-user/saned
     Available versions:  0
     Installed versions:  0(11:36:44 03/09/21)
     Description:         User for media-gfx/sane-backends

[I] media-gfx/sane-backends
     Available versions:  1.0.31-r2 {gphoto2 ipv6 snmp systemd threads usb v4l xinetd +zeroconf ABI_MIPS="n32 n64 o32" ABI_S390="32 64" ABI_X86="32 64 x32" SANE_BACKENDS="+abaton +agfafocus +apple +artec +artec_eplus48u +as6e +avision +bh +canon +canon630u +canon_dr +canon_lide70 canon_pp +cardscan +coolscan +coolscan2 +coolscan3 +dc25 +dc210 +dc240 +dell1600n_net +dmc +epjitsu +epson +epson2 +escl +fujitsu +genesys +gt68xx +hp +hp3500 +hp3900 +hp4200 +hp5400 +hp5590 +hpljm1005 hpsj5s +hs2p +ibm +kodak +kodakaio +kvs20xx kvs40xx +kvs1025 +leo +lexmark +ma1509 +magicolor +matsushita +microtek +microtek2 +mustek mustek_pp +mustek_usb mustek_usb2 +nec +net +niash +p5 +pie +pieusb +pixma +plustek +plustek_pp pnm +qcam +ricoh +ricoh2 +rts8891 +s9036 +sceptre +sharp +sm3600 +sm3840 +snapscan +sp15c +st400 +stv680 +tamarack +teco1 +teco2 +teco3 +test +u12 +umax +umax1220u +umax_pp +xerox_mfp"}
     Installed versions:  1.0.31-r2(13:54:39 14/09/21)(ipv6 usb zeroconf -gphoto2 -snmp -systemd -threads -v4l -xinetd ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" SANE_BACKENDS="net -abaton -agfafocus -apple -artec -artec_eplus48u -as6e -avision -bh -canon -canon630u -canon_dr -canon_lide70 -canon_pp -cardscan -coolscan -coolscan2 -coolscan3 -dc25 -dc210 -dc240 -dell1600n_net -dmc -epjitsu -epson -epson2 -escl -fujitsu -genesys -gt68xx -hp -hp3500 -hp3900 -hp4200 -hp5400 -hp5590 -hpljm1005 -hpsj5s -hs2p -ibm -kodak -kodakaio -kvs20xx -kvs40xx -kvs1025 -leo -lexmark -ma1509 -magicolor -matsushita -microtek -microtek2 -mustek -mustek_pp -mustek_usb -mustek_usb2 -nec -niash -p5 -pie -pieusb -pixma -plustek -plustek_pp -pnm -qcam -ricoh -ricoh2 -rts8891 -s9036 -sceptre -sharp -sm3600 -sm3840 -snapscan -sp15c -st400 -stv680 -tamarack -teco1 -teco2 -teco3 -test -u12 -umax -umax1220u -umax_pp -xerox_mfp")
     Homepage:            http://www.sane-project.org/
     Description:         Scanner Access Now Easy - Backends

[I] media-gfx/xsane
     Available versions:  0.999-r3 {gimp jpeg lcms nls ocr png tiff}
     Installed versions:  0.999-r3(20:53:33 03/09/21)(gimp jpeg lcms png tiff -nls -ocr)
     Homepage:            http://www.xsane.org/
     Description:         Graphical scanning frontend

$ Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1/no-multilib, gcc-10.3.0, glibc-2.33-r1, 5.10.61-gentoo x86_64)
=================================================================
System uname: Linux-5.10.61-gentoo-x86_64-Intel-R-_Core-TM-_i5-3450_CPU_@_3.10GHz-with-glibc2.33
KiB Mem:    16353228 total,  11709280 free
KiB Swap:   10485756 total,  10485756 free
Timestamp of repository gentoo: Thu, 23 Sep 2021 19:06:31 +0000
Head commit of repository gentoo: 34c2d7c6a721994cac1f42115bcffcd269ff2e49

Head commit of repository pf4public: c2ad78b76ffc55e80768e6737badc6324843e9d6

sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
distcc 3.4 x86_64-pc-linux-gnu [disabled]
ccache version 4.3 [enabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r2::gentoo
dev-lang/python:          2.7.18_p13::gentoo, 3.8.12::gentoo, 3.9.6_p2::gentoo
dev-lang/rust-bin:        1.53.0::gentoo
dev-util/ccache:          4.3-r3::gentoo
dev-util/cmake:           3.20.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.43.5::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.4::gentoo
sys-devel/binutils:       2.37_p1::gentoo
sys-devel/gcc:            10.3.0-r2::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r1::gentoo
Repositories:

gentoo
    location: /home/ramon/.var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

keks24
    location: /usr/local/share/git/keks24/gentoo-overlay
    masters: gentoo

pf4public
    location: /home/ramon/.var/db/repos/pf4public
    sync-type: git
    sync-uri: https://github.com/PF4Public/gentoo-overlay.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-ftree-vectorize -O2 -pipe -march=ivybridge -mtune=ivybridge"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-ftree-vectorize -O2 -pipe -march=ivybridge -mtune=ivybridge"
DISTDIR="/var/db/repos/gentoo/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 4 --load-average 3.6"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-ftree-vectorize -O2 -pipe -march=ivybridge -mtune=ivybridge"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs
protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-ftree-vectorize -O2 -pipe -march=ivybridge -mtune=ivybridge"
GENTOO_MIRRORS="http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/ http://ftp.daum.net/gentoo/ http://ftp.dei.uc.pt/pub/linux/gentoo/"
LANG="en_GB.utf8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="--jobs 4 --load-average 3.6"
PKGDIR="/var/db/repos/gentoo/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git
"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 acl alsa amd64 bluetooth bzip2 cdda cdr cli crypt css cups dbus dri dts dvd dvdr elogind ffmpeg fortran gdbm iconv icu ipv6 libglvnd libtirpc ncurses nptl openmp pam pcre policykit pulseaudio readline seccomp split-usr ssl tcpd
udev unicode usb vdpau xattr zlib zsh-completion zstd" ABI_X86="64" ADA_TARGET="gnat_2019" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestr
o3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_
host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling s
tatus unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx f16c mmx mmxext pclmul popcnt sse sse2 sse3 sse4_1 sse4_2 sss
e3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt
ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-GB" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_
SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9 python3_8" SANE_BACKENDS="net"
USERLAND="GNU" VIDEO_CARDS="intel mesa r600 radeon virtualbox" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos acco
unt"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

Server:
$ dpkg --list | grep "sane"
ii  libsane:armhf                  1.0.27-3.2                          armhf        API library for scanners
ii  libsane-common                 1.0.27-3.2                          all          API library for scanners -- documentation and support files
ii  sane-utils                     1.0.27-3.2                          armhf        API library for scanners -- utilities
Comment 1 Ramon Fischer 2021-09-28 20:36:40 UTC
Created attachment 741807 [details]
Hewlett-Packard:Scanjet2200c.drc

Hewlett-Packard:Scanjet2200c.drc
Comment 2 Ramon Fischer 2021-09-28 20:38:13 UTC
Created attachment 741810 [details]
xsane configuration

20210928-211026_screenshot.png
Comment 3 Ramon Fischer 2021-09-28 20:44:34 UTC
Created attachment 741813 [details]
Censored strace_xsane

strace_xsane
Comment 4 Ramon Fischer 2021-09-29 06:09:07 UTC
Created attachment 741825 [details]
plustek.conf

Server driver configuration file.
Comment 5 Mike Gilbert gentoo-dev 2021-09-30 17:27:58 UTC
I would suggest rebuilding xsane with debug symbols enabled and getting a backtrace.

https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
Comment 6 Ramon Fischer 2021-10-22 18:25:00 UTC
Created attachment 746178 [details]
xsane_backtrace.log

(In reply to Mike Gilbert from comment #5)
> I would suggest rebuilding xsane with debug symbols enabled and getting a
> backtrace.
> 
> https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces

I recompiled "xsane-0.999-r3" with debug information and without any optimisations:

    $ CFLAGS="-Og -pipe -march=ivybridge -mtune=ivybridge -ggdb" CXXFLAGS="${CFLAGS}" FEATURES="nostrip" emerge --ask xsane
    $ < "/var/db/pkg/media-gfx/xsane-0.999-r3/CFLAGS"
    -Og -pipe -march=ivybridge -mtune=ivybridge -ggdb
    $ < "/var/db/pkg/media-gfx/xsane-0.999-r3/CXXFLAGS"
    -Og -pipe -march=ivybridge -mtune=ivybridge -ggdb

I then installed "gdb" to get backtrace information:

    $ emerge --ask --oneshot gdb

After that logged the program crash with backtrace information:

    $ cd "$(mktemp --directory)"
    $ scanimage --list-devices
    device `net:<some_server_hostname>:plustek:libusb:001:006' is a Hewlett-Packard Scanjet 2200c flatbed scanner
    default device is `net:<some_server_hostname>:plustek:libusb:001:006'
    $ gdb -quiet xsane
    Reading symbols from xsane...
    (gdb) set logging file xsane_backtrace.log
    (gdb) set logging on
    Copying output to xsane_backtrace.log.
    Copying debug output to xsane_backtrace.log.
    (gdb) set environment SANE_DEFAULT_DEVICE="net:<some_server_hostname>:plustek:libusb:001:006"
    (gdb) show environment SANE_DEFAULT_DEVICE
    SANE_DEFAULT_DEVICE="net:<some_server_hostname>:plustek:libusb:001:006"
    (gdb) run
    Starting program: /usr/bin/xsane
    [...]
    Thread 1 "xsane" received signal SIGPIPE, Broken pipe.
    0x00007ffff755108f in write () from /lib64/libpthread.so.0
    (gdb) thread apply all bt full
    Thread 7 (Thread 0x7ffff3c1b640 (LWP 27516) "xsane"):
    #0  0x00007ffff747389f in poll () at /lib64/libc.so.6
    #1  0x00007ffff2b06e4a in  () at /usr/lib64/libavahi-common.so.3
    [...]
    (gdb) continue
    Continuing.
    free(): invalid pointer

    Thread 1 "xsane" received signal SIGABRT, Aborted.
    0x00007ffff73be811 in raise () from /lib64/libc.so.6
    (gdb) thread apply all bt full
    Thread 7 (Thread 0x7ffff3c1b640 (LWP 27516) "xsane"):
    #0  0x00007ffff747389f in poll () at /lib64/libc.so.6
    #1  0x00007ffff2b06e4a in  () at /usr/lib64/libavahi-common.so.3
    [...]
    (gdb) continue
    Continuing.
    [Thread 0x7ffff3c1b640 (LWP 27516) exited]

    Program terminated with signal SIGABRT, Aborted.
    The program no longer exists.
    (gdb) thread apply all bt full
    (gdb) set logging off
    Done logging to xsane_backtrace.log.
    (gdb) quit

For some reason "xsane" is behaving differently, when executed from "gdb". It is asking for authorisation, when I change the scan mode, instead of dying with the signal "SIGSEGV".

I also cannot get to the point, where the process receives the signal "SIGSEGV". I tried the following handling settings, but without success:

    (gdb) handle SIGPIPE SIGABRT nostop noprint noignore pass
    Signal        Stop      Print   Pass to program Description
    SIGABRT       No        No      Yes             Aborted
    SIGPIPE       No        No      Yes             Broken pipe

"xsane" then just exits and "gdb" returns:

    Program terminated with signal SIGABRT, Aborted.
    The program no longer exists.

-Ramon