[MOD] STR #4044: parallel backend can hang in an infinite loop

Till Kamppeter <[email protected]>
Newsgroups gmane.comp.printing.cups.bugs
Message-ID <[email protected]>
DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

This bug report is only for CUPS 1.5.x. In CUPS 1.6.x there is no parallel
backend any more as it has moved to cups-filters at OpenPrinting and there
I have already fixed this bug with the attached patch.

The parallel backend can hang in an infinite loop by the side-channel
read. See

https://bugs.launchpad.net/ubuntu/+source/cups-filters/+bug/936647

I have fixed this with the attached patch and the reporter of the linked
bug has confirmed that the patch solves the problem.

Link: http://www.cups.org/str.php?L4044
Version: 1.5.2

_______________________________________________
cups-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/cups-bugs
parallel-backend-do-not-hang-on-sidechannel.patch (text/plain, 572 B)
--- backend/parallel.c	2012-03-10 22:23:22.933835372 +0100
+++ backend/parallel.c	2012-03-10 22:19:48.349835358 +0100
@@ -657,10 +657,13 @@
      /*
       * Do the side-channel request, then start back over in the select
       * loop since it may have read from print_fd...
+      *
+      * If the side channel processing errors, go straight on to avoid
+      * blocking of the backend by side channel problems.
       */
 
-      side_cb(print_fd, device_fd, use_bc);
-      continue;
+      if (side_cb(print_fd, device_fd, use_bc) >= 0)
+	continue;
     }
 
    /*
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.