[cups.bugs] [MOD] STR #2780: pdftops does not handle EINTR

martin.pitt.canonical martin.pitt at canonical.com
Wed Apr 2 01:33:18 PDT 2008


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

[STR New]

First, a big thanks for the much improved test suite in 1.3.7! By comparing
expected number of errors it promptly caught a failure when I prepared
1.3.7 packages for Debian/Ubuntu:

E [02/Apr/2008:02:47:45 +0200] PID 20824
(/tmp/cups-martin/bin/filter/pdftops) stopped with status 1!

We use the pdftops filter from 1.4 svn head on 1.3.7.

I tracked this down to pdftops.c's wait() failing on EINTR (yay, my
favourite of "ten things I hate about Unix" did it again). Attached patch
handles this properly, similar to other parts in the code which run
wait().

BTW, it took me quite some time to debug this. Calling the filter manually
with identical arguments on the command line succeeded. Smuggling gdb in
between cupsd and pdftops does not work easily due to stdin not being a
console, and for race conditions like that it's probably quite useless
anyway. The existing fprintf()s to stderr do not leave any trace in
error_log or anywhere else, so I ended up cluttering the code with
fprintf() to a newly created log file. Is there a better/easier method to
debug a filter?

Thanks,

Martin

Link: http://www.cups.org/str.php?L2780
Version: 1.4-current
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdftops-wait-eintr.dpatch
Type: application/octet-stream
Size: 1079 bytes
Desc: not available
URL: <https://lists.cups.org/pipermail/cups/attachments/20080402/87a99d12/attachment.obj>


More information about the cups mailing list