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 708783 - [x11-libs/gtk-+2.24.20]: printing crashes gtk based apps (firefox, chromium, gimp, ...)
[x11-libs/gtk-+2.24.20]: printing crashes gtk based apps (firefox, chromium, ...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Printing
2.24.x
Other Linux
: High critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 708798 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-09-25 21:18 UTC by thomas.bettler
Modified: 2014-03-13 03:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Bump required GLib version (861 bytes, patch)
2013-10-02 11:13 UTC, Timothy Arceri
reviewed Details | Review
printbackend/cups: Check before using g_clear_pointer/object (1.70 KB, patch)
2013-10-02 11:53 UTC, Emmanuele Bassi (:ebassi)
needs-work Details | Review
Don't crash because of missing g_clear_pointer() (2.19 KB, patch)
2014-03-12 09:56 UTC, Marek Kašík
accepted-commit_now Details | Review

Description thomas.bettler 2013-09-25 21:18:30 UTC
After updating to gtk+-2.24.20 firefox & co crash right after the print dialog has disappeared (print or even cancel).

Problem:
After a bisect I can tell the problem is related to upstream commit a057ed26dc623dff0fc0c62ef287f6583b2710d0 which introduces the use of function g_clear_pointer()

This very function has been introduced by >=glib-2.34. Compiling with glib-2.32.4 works although it gives a warning: "implicit declaration of function ‘g_clear_pointer’ [-Wimplicit-function-declaration]"
However firefox crashes on printing operations (and even page settings) with the output: "symbol lookup error: /usr/lib64/gtk-2.0/2.10.0/printbackends/libprintbackend-cups.so: undefined symbol: g_clear_pointer"

Solution:
Depend gtk+-2.24.20 on >=glib-2.34
Comment 1 Timothy Arceri 2013-10-02 11:13:16 UTC
Created attachment 256252 [details] [review]
Bump required GLib version
Comment 2 Emmanuele Bassi (:ebassi) 2013-10-02 11:44:57 UTC
Review of attachment 256252 [details] [review]:

I'm not a fan of bumping requirements in supposedly stable branches; I'd rather use a compile time version:

    #if GLIB_VERSION_CHECK(2, 28, 0)
      g_clear_pointer();
    #else
      if (value != NULL)
        {
          g_object_unref();
          value = NULL;
        }
    #endif

or a simple implementation of g_clear_pointer() copied from GLib, and conditionally compiled.

on the other hand, gtk-2-24 is "special", so we could very well get away with the dependency bump.
Comment 3 Emmanuele Bassi (:ebassi) 2013-10-02 11:53:03 UTC
Created attachment 256253 [details] [review]
printbackend/cups: Check before using g_clear_pointer/object

We need to check the version of GLib we're being compiled against,
otherwise we'd have to bump up the dependency.
Comment 4 Matthias Clasen 2013-10-02 13:16:27 UTC
I don't think this is worth it tbh - we should just use

g_object_unref(p); p = NULL;

unconditionally - the atomicity is really immaterial here.
Comment 5 Matthias Clasen 2013-10-02 13:16:45 UTC
Review of attachment 256253 [details] [review]:

.
Comment 6 Timothy Arceri 2013-10-02 22:32:00 UTC
*** Bug 708798 has been marked as a duplicate of this bug. ***
Comment 7 Marek Kašík 2014-03-12 09:56:54 UTC
Created attachment 271587 [details] [review]
Don't crash because of missing g_clear_pointer()

The attached patch replaces the g_clear_pointer() by g_free() and setting of the pointers to NULL.
Comment 8 Matthias Clasen 2014-03-12 15:23:18 UTC
Review of attachment 271587 [details] [review]:

sure