Bug 56540 - batch scanning (microtek2 drivers) kills everything in sight
batch scanning (microtek2 drivers) kills everything in sight
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: sane-backends (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-11-20 13:52 EST by Michal Jaegermann
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-03-04 18:50:32 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


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

  None (edit)
Description Michal Jaegermann 2001-11-20 13:52:14 EST
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 13:53:41 EST
Created attachment 38066 [details]
a patch to make possible batch scanning with microtek2 driver
Comment 2 Tim Waugh 2001-11-20 17:38:52 EST
Already applied in sane-backends-1.0.6-2, currently in rawhide.
Comment 3 Michal Jaegermann 2002-03-04 18:50:27 EST
> 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 04:15:44 EST
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.