GNOME Bugzilla – Bug 708783
[x11-libs/gtk-+2.24.20]: printing crashes gtk based apps (firefox, chromium, gimp, ...)
Last modified: 2014-03-13 03:47:43 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
Created attachment 256252 [details] [review] Bump required GLib version
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.
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.
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.
Review of attachment 256253 [details] [review]: .
*** Bug 708798 has been marked as a duplicate of this bug. ***
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.
Review of attachment 271587 [details] [review]: sure