[cups.bugs] [MOD] STR #3001: backend runloop spins on backchannel EOF

martin.pitt.canonical martin.pitt at canonical.com
Thu Nov 13 03:32:10 PST 2008


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

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 at 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).

Link: http://www.cups.org/str.php?L3001
Version: 1.3.9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: runloop-backchannel-eof-spin.dpatch
Type: application/octet-stream
Size: 1293 bytes
Desc: not available
URL: <https://lists.cups.org/pipermail/cups/attachments/20081113/93a5beb0/attachment.obj>


More information about the cups mailing list