Bug 102999 - native GTK3 (Gnome) print dialog crashes if the printer is password protected
Summary: native GTK3 (Gnome) print dialog crashes if the printer is password protected
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Printing and PDF export (show other bugs)
Version:
(earliest affected)
5.2.2.2 release
Hardware: All All
: medium normal
Assignee: Caolán McNamara
URL:
Whiteboard: target:5.3.0 target:5.2.4
Keywords:
Depends on:
Blocks: GTK3
  Show dependency treegraph
 
Reported: 2016-10-05 04:43 UTC by Drew Parsons
Modified: 2016-12-20 07:14 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Drew Parsons 2016-10-05 04:43:26 UTC
Because of bug#53029 we can't print directly to password-protected printers. A suggested workaround is to deactivate LibreOffice print dialogs (one of the Advanced experimental features) and use native print dialogs instead.

But this workaround fails on a Gnome 3 system, which uses gtk3 print dialogs (e.g. installed via Debian package libreoffice-gtk3). Instead the print dialog crashes, causing LibreOffice to restart and invoke "Document Recovery",
but it never completes the print job. 

Error messages are printed at the time of the crash:

GLib-GObject-CRITICAL **: g_object_new_valist: invalid unclassed object pointer for value type 'GtkPrinter'

Gtk-CRITICAL **: gtk_printer_get_backend: assertion 'GTK_IS_PRINTER (printer)' failed

GLib-GObject-CRITICAL **: g_object_ref: assertion 'G_IS_OBJECT (object)' failed

The bug is in the gtk3 handler only.  If I install libreoffice-gtk2 instead of libreoffice-gtk3 then a dialog box pops up requesting the password for the printer, and the print job is successful.

As a workaround (using gtk3), I can instead print to pdf. The pdf viewer (evince) can then print the pdf document via a gtk3 print dialog. i.e. gtk3 printing is in general working.

Versions:
libreoffice   1:5.2.2~rc2-2
libgtk-3-0    3.22.1-1

Reported also in Debian bug#839701.
Comment 1 Caolán McNamara 2016-10-13 12:34:17 UTC
This is with the experimental feature enabled and the use LibreOffice print dialog disabled I suppose ?
Comment 2 Caolán McNamara 2016-10-13 13:30:29 UTC
For me it crashes password or not. I think the underlying bug is not dependent on gtk3 but existed before that too.
Comment 3 Commit Notification 2016-10-13 13:35:44 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c12e14d19f86be8555f6262d138cf0776f2c9b56

Resolves: tdf#102999 get_selected_printer is transfer none

It will be available in 5.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 4 Drew Parsons 2016-10-13 15:06:47 UTC
That's right, it's the experimental use of the native dialog, i.e. with the LibreOffice print dialog disabled.

I figured it was gtk3 only since it works with the gtk2 print dialog.  But anyway, I hope the patch fixes it.  I'll confirm if it does once 5.3.0 reaches me.
Comment 5 Commit Notification 2016-10-13 18:43:58 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "libreoffice-5-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=bb51869d5fd339703767e1e70c832a803dd981eb&h=libreoffice-5-2

Resolves: tdf#102999 get_selected_printer is transfer none

It will be available in 5.2.4.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Drew Parsons 2016-12-20 07:14:50 UTC
Tested on the 5.2.4 release candidate (Debian 1:5.2.4~rc1-1).
The patch works fine, thank you!