[cups.bugs] [MOD] STR #2808: STR #2780 changed pdftops exit code behaviour

martin.pitt.canonical martin.pitt at canonical.com
Mon Apr 21 10:21:42 PDT 2008


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

[STR New]

Hello,

in http://www.cups.org/str.php?L2780 you fixed the EINTR problem I
reported, thank you! However, your patch introduced a change in behaviour:
when cancelling a job (and thus calling the signal handler, which sets
job_canceled=1), the following "pdfwaitpid != pdfpid" matches, since
wait() returned -1/EINTR, but due to job_canceled==1, the while loop was
broken. This would then always be considered as a failure, i. e. pdftops
would exit with 1.

When applying that patch (instead of mine), the test suite now fails on
"11 errors instead of expected 9", on the following:

E [21/Apr/2008:16:57:40 +0000] PID 29175
(/tmp/cups-martin/bin/filter/pdftops) stopped with status 1!
E [21/Apr/2008:16:57:40 +0000] PID 29177
(/tmp/cups-martin/bin/filter/pstops) stopped with status 1!

There are two possibilities:
 - pdftops is actually meant to exit with 1 when a job is cancelled. Then
the test cases need to be updated.
 - pdftops should succeed if a job is cancelled. Then something like the
attached patch should help. (NB that I also added 'volatile', just for
robustness; gcc seems to be clever enough to not optimize away the lookup
in the while loop, though)

That helps to drop the error messages from 11 to 10, I still get 

  E [21/Apr/2008:17:13:22 +0000] PID 4457
(/tmp/cups-martin/bin/filter/pstops) stopped with status 1!

which I don't get if I unapply your patch in STR #2780 and just apply my
proposed patch there. I do see that the idea of your patch is better, but
ATM I seem to be too blind to spot the problem...

Thank you!

Link: http://www.cups.org/str.php?L2808
Version: 1.4-current
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pdftops-dont_fail_on_cancel.dpatch
Type: application/octet-stream
Size: 774 bytes
Desc: not available
URL: <https://lists.cups.org/pipermail/cups/attachments/20080421/519baf3c/attachment.obj>


More information about the cups mailing list