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 793529 - quick closing & opening of Print dialog makes a CUPS printer disappear (be not found/displayed)
quick closing & opening of Print dialog makes a CUPS printer disappear (be no...
Status: RESOLVED OBSOLETE
Product: gtk+
Classification: Platform
Component: Printing
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2018-02-17 12:00 UTC by Ivan Zakharyaschev
Modified: 2018-02-19 15:14 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
atril.debug.0.xz (6.06 KB, application/x-xz)
2018-02-17 12:00 UTC, Ivan Zakharyaschev
Details

Description Ivan Zakharyaschev 2018-02-17 12:00:54 UTC
Created attachment 368467 [details]
atril.debug.0.xz

Let me describe a way how we can reproduce this bug:

0. Install cups-pdf. (This will be the CUPS printer that will be used to test the appearance of a CUPS printer in the Print dialog.)

1. Press Ctrl-P (in atril built with libgtk+2-2.24.32; this has also been reproduced in firefox; and with 2.24.21; and probably with libgtk+3-3.22.26), select CUPS-PDF, print a page.

2. Press Ctrl-P.

3. Press Esc (to close the Print dialog).

Repeat 2 and 3 quickly many times. (Sometimes 3 times is enough, sometimes 20.) 

Result: in the last Print dialog, CUPS-PDF is not in the list anymore.

Expected result: CUPS-PDF is in the listand can be printed to.

In the invocation of the Print dialog before the last one, before one presses Esc, CUPS-PDF is usually listed, but the "Print" button is not active (yet). It looks as if the Print dialog is still getting some information from the printer.

(We have learned of this bug from people who have been using the Print dialog in a virtual machine, so as for now, we tried to reproduce this in similar conditions only, i.e., in a VirtualBox inside a kvm virtual machine, and I'm not sure whether it is easy to get this on real hardware.)

Of course, this looks like a race or a collision in the connections from Gtk to CUPS. (I have compared this to the behavior of the Qt Print dialog, and there was no such problem with Qt, so I believe the cups server probably works well accepting connections through cups.sock.)

I have compiled libgtk+2-2.24.32 with --enable-debug=yes , and I'll show below the debugging messages when this bug appears.

(As for libgtk+2-2.24.21 compiled with --enable-debug=yes , surprizingly, the Print dialog was not usable at all: already on the first invocation, CUPS-PDF never became ready to print, even when no environment variables to output the debugging messages were set, i.e.: no debugging information was output to the terminal, but the dialog was not usable.)

Debugging:

I ran it like this:

G_MESSAGES_DEBUG=printing GTK_DEBUG=printing atril /usr/share/doc/dia/en/dia.pdf &>atril.debug.0

Here is some interesting stuff:

First, do:

sed -i -re 's:ignored:&\n:' atril.debug.0

because of a missing newline in one of the debugging messages (a minor bug I should report separately).

[user@prodesk0 ~]$ egrep 'request_exec|finaliz|dispose' atril.debug.0 
CUPS Backend: cups_request_execute <source 0x9efb90> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_request_execute <source 0xa36380> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/printers/Cups-PDF.ppd'
CUPS Backend: cups_dispatch_watch_finalize <source 0x9efb90>
CUPS Backend: cups_dispatch_watch_finalize <source 0xa36380>
CUPS Backend: cups_request_execute <source 0x9ec840> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0x9ec840>
CUPS Backend: cups_request_execute <source 0xa72c00> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa72c00>
CUPS Backend: cups_request_execute <source 0xa72050> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa72050>
CUPS Backend: cups_request_execute <source 0xa72320> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa72320>
CUPS Backend: cups_request_execute <source 0xa72320> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa72320>
CUPS Backend: cups_request_execute <source 0xa72fc0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa72fc0>
CUPS Backend: cups_request_execute <source 0xa73000> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa73000>
CUPS Backend: cups_request_execute <source 0xa72340> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa72340>
CUPS Backend: cups_request_execute <source 0xa72320> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa72320>
CUPS Backend: cups_request_execute <source 0xa73470> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa73470>
CUPS Backend: cups_request_execute <source 0xa72320> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa72320>
CUPS Backend: cups_request_execute <source 0xa73390> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa73390>
CUPS Backend: cups_request_execute <source 0xa73350> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa73350>
CUPS Backend: cups_request_execute <source 0xa73390> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa73390>
CUPS Backend: cups_request_execute <source 0xa73390> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa73390>
CUPS Backend: gtk_print_backend_cups_dispose
CUPS Backend: cups_request_execute <source 0xa4a900> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_request_execute <source 0x9b5bf0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/printers/Cups-PDF.ppd'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa4a900>
CUPS Backend: cups_dispatch_watch_finalize <source 0x9b5bf0>
CUPS Backend: cups_request_execute <source 0xa55810> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa55810>
CUPS Backend: cups_request_execute <source 0xa87600> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa87600>
CUPS Backend: cups_request_execute <source 0xa876c0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa876c0>
CUPS Backend: cups_request_execute <source 0xa87360> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa87360>
CUPS Backend: cups_request_execute <source 0xa879d0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa879d0>
CUPS Backend: gtk_print_backend_cups_dispose
CUPS Backend: cups_request_execute <source 0x9b21d0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_request_execute <source 0xa22900> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/printers/Cups-PDF.ppd'
CUPS Backend: cups_dispatch_watch_finalize <source 0x9b21d0>
CUPS Backend: cups_dispatch_watch_finalize <source 0xa22900>
CUPS Backend: cups_request_execute <source 0xa658c0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa658c0>
CUPS Backend: cups_request_execute <source 0xa9c610> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa9c610>
CUPS Backend: cups_request_execute <source 0xa9c000> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa9c000>
CUPS Backend: cups_request_execute <source 0xa9c0c0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa9c0c0>
CUPS Backend: cups_request_execute <source 0xa9c0a0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa9c0a0>
CUPS Backend: gtk_print_backend_cups_dispose
CUPS Backend: cups_request_execute <source 0xa359e0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_request_execute <source 0xa20f20> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/printers/Cups-PDF.ppd'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa359e0>
CUPS Backend: cups_dispatch_watch_finalize <source 0xa20f20>
CUPS Backend: cups_request_execute <source 0xaa2a90> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xaa2a90>
CUPS Backend: cups_request_execute <source 0xaa29b0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xaa29b0>
CUPS Backend: cups_request_execute <source 0xaa29e0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xaa29e0>
CUPS Backend: cups_request_execute <source 0xaa29e0> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xaa29e0>
CUPS Backend: gtk_print_backend_cups_dispose
CUPS Backend: cups_request_execute <source 0x98a730> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_request_execute <source 0xa67d90> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/printers/Cups-PDF.ppd'
CUPS Backend: cups_dispatch_watch_finalize <source 0x98a730>
CUPS Backend: gtk_print_backend_cups_dispose
CUPS Backend: cups_request_execute <source 0xa33710> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'
CUPS Backend: cups_dispatch_watch_finalize <source 0xa67d90>
[user@prodesk0 ~]$ 

Note above that each cups_request_execute is followed by a corresponding cups_dispatch_watch_finalize. (And a pair of cups_request_execute is always followed by a pair of corresponding cups_dispatch_watch_finalize.) But the one before the last one:

CUPS Backend: cups_request_execute <source 0xa67d90> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/printers/Cups-PDF.ppd'

is not matched by a corresponding cups_dispatch_watch_finalize, and the the next one is executed:

CUPS Backend: cups_request_execute <source 0xa33710> - Executing cups request on server '/var/run/cups/cups.sock' and resource '/'

and after that a non-corresponding cups_dispatch_watch_finalize occurs. The the Print dialog is being displayed without CUPS-PDF ever appearing in the list. (After a while, I terminated the process.)

The output is huge (attached):

$ wc -l atril.debug.0 
494422 atril.debug.0

and the tail is all about the last request:

[user@prodesk0 ~]$ tail atril.debug.0 
CUPS Backend: cups_dispatch_watch_prepare <source 0xa33710>
CUPS Backend: cups_dispatch_watch_check <source 0xa33710>
CUPS Backend: cups_dispatch_watch_prepare <source 0xa33710>
CUPS Backend: cups_dispatch_watch_check <source 0xa33710>
CUPS Backend: cups_dispatch_watch_prepare <source 0xa33710>
CUPS Backend: cups_dispatch_watch_check <source 0xa33710>
CUPS Backend: cups_dispatch_watch_prepare <source 0xa33710>
CUPS Backend: cups_dispatch_watch_check <source 0xa33710>
CUPS Backend: cups_dispatch_watch_prepare <source 0xa33710>
CUPS Backend: cups_dispatch_watch_check <source 0xa33710>
Comment 1 Daniel Boles 2018-02-19 15:14:44 UTC
I don't think we need new bugs filed in 2 places. Let's keep it at the new one:

https://gitlab.gnome.org/GNOME/gtk/issues/39