Bug 56540 - batch scanning (microtek2 drivers) kills everything in sight
Summary: batch scanning (microtek2 drivers) kills everything in sight
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: sane-backends
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-20 18:52 UTC by Michal Jaegermann
Modified: 2008-05-01 15:38 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2002-03-04 23:50:32 UTC


Attachments (Terms of Use)
a patch to make possible batch scanning with microtek2 driver (666 bytes, patch)
2001-11-20 18:53 UTC, Michal Jaegermann
no flags Details | Diff

Description Michal Jaegermann 2001-11-20 18:52:14 UTC
Description of Problem:

At least with microtek2 driver 'scanimage' in a batch mode and using
a document feeder has a nasty habit of killing all processes it can
reach.  Effects are much more spectacular when doing a test from
a root account. :-)

The problem is that 'cancel_scan()' is using a read with transfer
length of 0 after it detected "out of pages to scan" condition
(a generic I/O error is used for that - sigh!).  Subsequently
it is doing a cleanup job with 'close(ms->fd[1]);' followed by
'kill(ms->pid, SIGTERM);'.  The problem is that in such case both
ms->fd[1] and ms->pid were already set earlier to (-1).  While this
is not that bad with 'close' (still likely an undefined behaviour)
this is an "ouch time" with 'kill'; things work like they are written
but hard to believe that in an intended way.

I could test that only for microtek2 driver but 'kill' is used quite
widely in other backends as well.

An attached minimal patch fixes the problem at least for microtek2.

  Michal
  michal@harddata.com



Version-Release number of selected component (if applicable):


How Reproducible:


Steps to Reproduce:
1. 
2. 
3. 

Actual Results:


Expected Results:


Additional Information:

Comment 1 Michal Jaegermann 2001-11-20 18:53:41 UTC
Created attachment 38066 [details]
a patch to make possible batch scanning with microtek2 driver

Comment 2 Tim Waugh 2001-11-20 22:38:52 UTC
Already applied in sane-backends-1.0.6-2, currently in rawhide.


Comment 3 Michal Jaegermann 2002-03-04 23:50:27 UTC
> Already applied in sane-backends-1.0.6-2, currently in rawhide.
That is nice but sane-backends-1.0.5-4.1, build Thu Dec 20 06:24:10 2001
and released at the beginning of January as an update for 7.2 distro,
have the same problem as I just found when scanner I got now for testing
kicked me out from an X windows session.

Comment 4 Tim Waugh 2002-03-05 09:15:44 UTC
The update contains just security fixes and not extra bug fixes.  This bug is
fixed in rawhide, and will appear in the next release.


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