I have been happily using
scanadf with the
-S script --script-wait
parameters for a couple of years.
My script, called
scan_perpage, converts the image data to pdf, via a call to
However recently (I suspect since I updated from Fedora 17 to 19), the
called script hangs, and therefore
scanadf hangs. The script is hung
pnmtops command. The
pnmtops command itself is waiting for its
pnmtops output filter to complete, and it never does.
scan_perpage script directly on the raw scanner page output works fine. Running the
pnmtops command directly also works fine. It is only when run from
-S that the script hangs at
# rpm -q --info sane-backends Name : sane-backends Version : 1.0.23 Release : 13.fc19 # rpm -q --info sane-frontends Name : sane-frontends Version : 1.0.14 Release : 16.fc19 # rpm -q --info netpbm Name : netpbm Version : 10.61.02 Release : 5.fc19
Here is the output of my
scan script, which calls
$ scan -o output.pdf Scanning... scanadf: value for --resolution is: 300 scanadf: scanning image of size 2544x3300 pixels at 1 bits/pixel scanadf: acquiring gray frame Started script `/usr/local/bin/scan_perpage' as pid=10902 Scanned document scan-0001 pnmtops: Input maxval is 1. Postscript raster will have 1 bits per sample, so maxval = 1 pnmtops: Image will be 610.56 points wide by 792.00 points high, left edge 0.72 points from left edge of page, bottom edge 0.00 points from bottom of page; NOT turned to landscape orientation pnmtops: output filter spawned: pid 10904 pnmtops: Waiting for PID 10904 to exit Scanned 1 pages <the script hangs here>
Here is the process tree at the point of the hang:
10897 32072 /bin/sh /usr/local/bin/scan -o output.pdf 10898 10897 scanadf -vvv -d fujitsu -S /usr/local/bin/scan_perpage --script-wait --resolution 300 --mode Lineart -o scan-%04d 10902 10898 /bin/bash /usr/local/bin/scan_perpage scan-0001 10903 10902 pnmtops -verbose -imagewidth 8.5 -imageheight 11 scan-0001 10904 10903 pnmtops -verbose -imagewidth 8.5 -imageheight 11 scan-0001
Process 10904 (the forked
pnmtops "output filter") never finishes. An
strace indicates it is waiting on a "read".
I can't figure out why
pnmtops hangs when called via
scanadf, but when
called directly on the same file it works perfectly fine.
In addition, if the
pnmtops subprocess is killed manually, everything continues without any problem.