After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 387889 - cups backend has problems when there are too many printers
cups backend has problems when there are too many printers
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
unspecified
Other All
: Normal critical
: ---
Assigned To: gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2006-12-20 12:49 UTC by krishan purahoo
Modified: 2007-04-30 17:40 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
strace output for evince (991.13 KB, text/plain)
2006-12-22 11:59 UTC, krishan purahoo
  Details
the patch (6.82 KB, patch)
2007-04-29 23:14 UTC, Matthias Clasen
none Details | Review

Description krishan purahoo 2006-12-20 12:49:14 UTC
Steps to reproduce:
1. In oowriter (or evince), go to file -> print
2. If we have more than 227 printers (I am using CUPS for printing), the
   print dialog box comes up, but it is blank, and the whole application
   hangs (freezes). The only way to proceed is to kill the application.
3. 


Stack trace:


Other information:
I have reported this bug to openoffice (as I noticed it in 
openoffice initially), but on further investigation, it seems to happen in
evince as well. It seems to be a problem with the gtk2 print dialog (as both
these applications uses this for the printing dialog).
Comment 1 Wouter Bolsterlee (uws) 2006-12-21 00:13:27 UTC
This is a GTK+ bug which was recently fixed, I think

Does the hang really depend the number of printers in the list?

Please provide your GTK+ version, possible strace output, and a backtrace :)
Comment 2 krishan purahoo 2006-12-22 11:58:29 UTC
1. My gtk+ version is gtk+-1.2.10-55.fc6

2. Yes it does seems to depend on the number of printers installed
   (in CUPS). If I reduce the numbet of printers available to a 
   number lower than 227, this problem does not occur, and
   I can print in both openoffice/evince. This only happens
   if the number of printers is more than 227.

3. Here is a backtrace output as obtained using gdb, as follows:-
 
   a) gdb evince

   b) (gdb) run test.pdf

   c) In evince file -> print

   d) (everything hangs at this stage)

   e) kill evince

   f) run bt in gdb, gets the output below


Here is the output of 'bt'

  • #0 __kernel_vsyscall
  • #1 connect
    from /lib/libpthread.so.0
  • #2 httpAddrConnect
    from /usr/lib/libcups.so.2
  • #3 httpReconnect
    from /usr/lib/libcups.so.2
  • #4 httpConnectEncrypt
    from /usr/lib/libcups.so.2
  • #5 gtk_cups_request_new
    from /usr/lib/gtk-2.0/2.10.0/printbackends/libprintbackend-cups.so
  • #6 pb_module_init
    from /usr/lib/gtk-2.0/2.10.0/printbackends/libprintbackend-cups.so
  • #7 pb_module_init
    from /usr/lib/gtk-2.0/2.10.0/printbackends/libprintbackend-cups.so
  • #8 g_main_context_dispatch
    from /lib/libglib-2.0.so.0
  • #9 g_main_context_check
    from /lib/libglib-2.0.so.0
  • #10 g_main_loop_run
    from /lib/libglib-2.0.so.0
  • #11 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #12 g_cclosure_marshal_VOID__VOID
  • #13 __libc_start_main
    from /lib/libc.so.6
  • #14 g_cclosure_marshal_VOID__VOID

4. Attached is the output of strace
Comment 3 krishan purahoo 2006-12-22 11:59:55 UTC
Created attachment 78786 [details]
strace output for evince
Comment 4 Wouter Bolsterlee (uws) 2006-12-22 12:09:57 UTC
So it seems this is a GTK problem. The connection to cups is established it seems (from the strace output), but something goes wrong when reading data from the socket (or something like that).

Reassigning to GTK.
Comment 5 Matthias Clasen 2006-12-24 15:34:46 UTC
retitling for clarity
Comment 6 Matthias Clasen 2007-04-29 23:14:05 UTC
Looks to me like cups simply locks up if we start too many connections quickly, for getting the details of all printers.

The patch below gets all the details we want about the printers in the initial 
printer list request. That seems to work better.
Comment 7 Matthias Clasen 2007-04-29 23:14:52 UTC
Created attachment 87255 [details] [review]
the patch
Comment 8 Matthias Clasen 2007-04-30 17:40:43 UTC
2007-04-30  Matthias Clasen  <mclasen@redhat.com>

        * modules/printbackends/cups/gtkprintbackendcups.c: Get all
        the printer attributes when getting the list of printers,
        not via separate requests.  (#387889, Krishan Purahoo)