Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
backend runloop spins on backchannel EOF #3001
Comments
|
CUPS.org User: mike Um, if the backchannel is closed, then we should stop immediately as that is an error condition. |
|
CUPS.org User: mike Fixed in Subversion repository. Please test the attached alternate patch, which logs the read error and then disables back-channel reads until the job is done or we fail on a write... |
|
CUPS.org User: martin.pitt.canonical The reporters confirmed that this patch works fine. Thank you! |
|
"str3001.patch": Index: backend/runloop.c--- backend/runloop.c (revision 8127)
|
michaelrsweet
closed this
Nov 27, 2008
michaelrsweet
added
the
P3 - Moderate
label
Mar 17, 2016
michaelrsweet
added this to the Stable milestone
Mar 17, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
michaelrsweet commentedNov 13, 2008
Version: 1.3.9
CUPS.org User: martin.pitt.canonical
http://bugs.debian.org/489045 reported that 1.3.9 does not print anything when using HPJetDirect. Instead, the socket backend uses 100% CPU and just keeps spinning.
strace shows that it's spinning in the device_fd (backchannel) loop:
19284 select(6, [4 5], [5], NULL, NULL) = 1 (in [5])
19284 read(5, "", 1024)
Samuel Thibault samuel.thibault@ens-lyon.org tracked this down to a bug in backendRunLoop(): As stated in the manpage, select() reports an fd as "ready for reading" if it is EOF (i. e. read() returns 0). The current code does not intercept this and just keeps select()ing and read()ing. He also provided a patch to stop reading from device_fd on EOF.
The patch looks good and correct to me. It was confirmed to fix the printing (see Debian bug report trail).