CTRL-C does not cancel scanning completely

Bug #619209 reported by Johannes Meixner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
HPLIP
New
Undecided
Unassigned

Bug Description

See
https://bugzilla.novell.com/show_bug.cgi?id=631294

Using HPLIP 3.10.2 with my HP LaserJet 1220 all-in-one
I let it pull in the paper, scan a bit and then I press CTRL-C:
---------------------------------------------------------------------
user@host:/tmp $ scanimage \
  -d hpaio:/usb/HP_LaserJet_1220?serial=00XXXXXXXXXX >foo.pnm
^Cscanimage: received signal 2
scanimage: trying to stop scanner
---------------------------------------------------------------------
After several seconds, the HP LaserJet 1220 ejects the paper
but scanimage still hangs.
I need to do as root "kill -9 <PID_of_scanimage_process>"
to get it finally terminated.

In contrast for e.g. my Canon CanoScan N1240U/LiDE30
which uses the "plustek" driver in sane-backends it works:
---------------------------------------------------------------------
user@host:/tmp $ scanimage -d plustek:libusb:002:005 >foo.pnm
^Cscanimage: received signal 2
scanimage: trying to stop scanner
scanimage: sane_read: Operation was cancelled
user@host:/tmp $
---------------------------------------------------------------------

A more detailed analysis for the hpaio backend shows
that while it hangs after a CTRL-C, it is actually hanging
in a "futex(...)" system call which is perhaps the result
of a pthread_mutex_lock call in the hpaio driver
or of such a call in whatever lower-level library, see
https://bugzilla.novell.com/show_bug.cgi?id=631294
for details.

I guess that the hpaio backend should release a lock
when it gets a CTRL-C (i.e. SIGINT) or when whatever
termination signal is sent to it.

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.