Bug 56540

Summary: batch scanning (microtek2 drivers) kills everything in sight
Product: [Retired] Red Hat Linux Reporter: Michal Jaegermann <michal>
Component: sane-backendsAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-03-04 23:50:32 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
a patch to make possible batch scanning with microtek2 driver none

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



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.