scanimage -L crashes with HP ScanJet 4100c

Bug #119819 reported by Andreas Gustafsson
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sane-backends (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I have a HP ScanJet 4100c which I bought because it was listed as
having "complete" support in SANE according to
<http://www.sane-project.org/cgi-bin/driver.pl?manu=Hewlett+Packard>.

When I connect it to a PC running Ubuntu 7.04 and run
"scanimage -L", scanimage occasionally finds it, but usually
it either fails to find it or crashes with an assertion failure.

The following shell transcript shows all three types of behavior:

gson@gubuntu1:~$ lsusb
Bus 001 Device 002: ID 03f0:0101 Hewlett-Packard ScanJet 4100c
Bus 001 Device 001: ID 0000:0000
gson@gubuntu1:~$ scanimage -L
device `hp:libusb:001:002' is a Hewlett-Packard ScanJet 4100C flatbed scanner
gson@gubuntu1:~$ 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).
gson@gubuntu1:~$ scanimage -L
Segmentation fault (core dumped)
gson@gubuntu1:~$ gdb scanimage core
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(no debugging symbols found)
[informational messages omitted]
Core was generated by `scanimage --list'.
Program terminated with signal 6, Aborted.
#0 0xffffe410 in __kernel_vsyscall ()
(gdb) where
#0 0xffffe410 in __kernel_vsyscall ()
#1 0xb7d0fdf0 in raise () from /lib/tls/i686/cmov/libc.so.6
#2 0xb7d11641 in abort () from /lib/tls/i686/cmov/libc.so.6
#3 0xb7d0943b in __assert_fail () from /lib/tls/i686/cmov/libc.so.6
#4 0xb7874ad6 in sanei_hp_optset_scanmode ()
   from /usr/lib/sane/libsane-hp.so.1
#5 0xb78770ba in ?? () from /usr/lib/sane/libsane-hp.so.1
#6 0x08079620 in ?? ()
#7 0x080795c0 in ?? ()
#8 0xb7883a60 in ?? () from /usr/lib/sane/libsane-hp.so.1
#9 0x00000001 in ?? ()
#10 0x00000001 in ?? ()
#11 0x00000001 in ?? ()
#12 0xbfbfcff8 in ?? ()
#13 0x000004c0 in ?? ()
#14 0x08079898 in ?? ()
#15 0x08075574 in ?? ()
#16 0x00000000 in ?? ()
(gdb)
gson@gubuntu1:~$

I can provide shell access to the machine for anyone with a serious interest in looking into this.

Revision history for this message
SbiellONE (davide-bellettini) wrote :

With an HP OfficeJet 7110 on Ubuntu Feisty

$ lsusb
Bus 004 Device 001: ID 0000:0000
Bus 003 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 003: ID 03f0:2611 Hewlett-Packard
Bus 001 Device 001: ID 0000:0000

Revision history for this message
Koen (koen-beek) wrote :

I have installed a fresh gutsy 64 bit on a Dell E521 AMD machine, and have the same problem as Andreas Gustafsson

lsusb shows the follwing for my HP SCanJet 4100C
Bus 001 Device 003: ID 03f0:0101 Hewlett-Packard ScanJet 4100c

sane-find-scanner seems to find my usb scanner - HP ScanJet 4100C all the time
output : found USB scanner (vendor=0x03f0 [Hewlett-Packard], product=0x0101 [HP ScanJet 4100C]) at libusb:001:003

however xsane sometimes does not detect it, and if it detects it sometimes does not show it can scan in grayscale, ...

as with Andreas Scanimage -L sometimes core dumps, sometimes only finds a usb logitech video camera I also have connected and sometimes does find the ScanJet 4100C

I have some debugging info for the hp sane driver by doing the following : export SANE_DEBUG_HP=255
there are three behaviors for scanimage -L
1. core dump
2. ScanJet 4100C not detected - output attached
3. ScanJet 4100C detected - output attached

the following are the messages I think are relevant :
[hp] hp_attach: "libusb:001:003"
[hp] sanei_hp_device_info_get: searching libusb:001:003
[hp] sanei_hp_device_info_get: check libusb:001:003
[hp] hp_get_dev: New device libusb:001:003, connect-usb, scsi-request=0
[hp] sanei_hp_device_new: libusb:001:003
[hp] sanei_hp_device_info_get: searching libusb:001:003
[hp] sanei_hp_device_info_get: check libusb:001:003
[hp] hp_GetOpenDevice: device libusb:001:003 not open
[hp] hp_nonscsi_open: open usb with "libusb:001:003"
[hp] hp_nonscsi_open: device libusb:001:003 opened, fd=1
[hp] hp_AddOpenDevice: added device libusb:001:003 with fd=1
[hp] scsi_flush: writing 2 bytes:
[hp] 0x0000 1B 45 .E
[hp] sanei_hp_device_info_get: searching libusb:001:003
[hp] sanei_hp_device_info_get: check libusb:001:003
[hp] scsi_flush: writing 7 bytes:
[hp] 0x0000 1B 2A 73 32 35 37 45 .*s257E
[hp] sanei_hp_device_info_get: searching libusb:001:003
[hp] sanei_hp_device_info_get: check libusb:001:003
[hp] sanei_hp_device_info_get: searching libusb:001:003
[hp] sanei_hp_device_info_get: check libusb:001:003
[hp] scl_inq: read failed (End of file reached)
[hp] scl_errcheck: Can't read SCL error stack: End of file reached
[hp] hp_nonscsi_device_new: SCL reset failed
[hp] scsi_close: closing fd 1

it seems the hp sane backend gets an end of file error

I have tried the following but it did not help https://bugs.launchpad.net/ubuntu/+source/kvm/+bug/156085/comments/5

   thanks,

      Koen

Koen (koen-beek)
Changed in sane-backends:
status: New → Confirmed
Revision history for this message
.cobnet (mattias-campe) wrote :

I can confirm this bug, my Hewlett-Packard ScanJet 4100c is found by lsusb and sane-find-scanner, but not by xsane, nor scanimage -L:

$ scanimage -L
scanimage: hp-option.c:3713: hp_optset_fix_geometry_options: Assertion `tl_x && tl_y && br_x && br_y' failed.
Afgebroken (core dumped)

Revision history for this message
.cobnet (mattias-campe) wrote :

Maybe this link is interesting: http://www.nabble.com/scanimage--L-crashes-with-HP-ScanJet-4100c-td14826162.html Especially the following quotes:

"Maybe the ScanJet 4100 is a little bit too slow in answering and it does not deliver the expected answers in time. I will see if I can find a workaround. "

"in case of the failure no data was received from the scanner. The backend then retries to read the requested data again after waiting 0.1 seconds. You can try to increase the number of retries to see if this helps:
export SANE_HP_RDREDO=20
xsane hp

This will do 20 retries (2 seconds in total) before giving up. Please try if at least the xsane-GUI comes up. Maybe you then will run into an I/O-error during scanning."

"Seems to me that the hp-backend can do a workaround, but not worth for daily use. Could be that the HP ScanJet 4100 C is a little bit problematic concerning USB in certain environments. BTW, did you try to connect the scanner directly to an USB-connector on the back of the PC ? "

I personally tried to connect the scanner directly to an USB-connector on my PC (instead of through the USB-hub on my screen) and I could scan again. Unfortunately it only worked once :-(.

Revision history for this message
Jim Meyering (meyering) wrote :

Hi, I had the same problem and have just worked around it.
Here's the report w/patch I've just sent upstream:
http://thread.gmane.org/gmane.comp.graphics.scanning.sane.devel/12601

Revision history for this message
Koen (koen-beek) wrote :

I've made a hardy version of libsane with Jim's patch which seems to work for me

I have stored it in my ppa

you can download it by including my ppa as a source : System->Administration->Software Sources->Third Party Software->Add-> ...
     deb http://ppa.launchpad.net/koen-beek/ubuntu hardy main
     deb-src http://ppa.launchpad.net/koen-beek/ubuntu hardy main

Revision history for this message
Andreas Gustafsson (gson) wrote :

I just tried Koen Beek's libsane version under Hardy and can confirm that it fixes the problem for me.

Revision history for this message
Koen (koen-beek) wrote :

I don't seem to have this problem anymore in Intrepid

anyone else still have this problem in intrepid ?

Revision history for this message
.cobnet (mattias-campe) wrote :

Even in Intrepid I still have problems and I even have less than I used to have (see my message from 2007-12-18)

$ lsusb | grep "ScanJet 4100c"
Bus 005 Device 005: ID 03f0:0101 Hewlett-Packard ScanJet 4100c

$ sane-find-scanner | grep libusb
found USB scanner (vendor=0x03f0, product=0x0101) at libusb:005:005

$ 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 command 'scanimage -L' used to give me more information in an older version of Ubuntu (can't remember which one).

The scanner still works with Microsoft Windows XP Professional SP3.

Revision history for this message
Pavel Niedoba (pavel-niedoba) wrote :

My scanner cannon LIDO 50 worked perfectly in Intrepid, completely stopped working in Jaunty. was always failing with USB communication error. I downgraded libsane to libsane_1.0.19-23ubuntu7_amd64.deb and it started working, but only till reboot. Now if I run it as user, scanimage says no devices, but sane-find-scanner finds it. if I run as root I get segmentation fault right away. Nothing bother me about ubuntu but things which worked like charm and they stop after upgrade.

Revision history for this message
Andreas Moog (ampelbein) wrote : Still an issue?

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue for you. Can you try with the latest Ubuntu release? Thanks in advance.

Changed in sane-backends (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for sane-backends (Ubuntu) because there has been no activity for 60 days.]

Changed in sane-backends (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.