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 679537 - Crash in GtkEntry gtk_entry_get_icon_pixbuf()
Crash in GtkEntry gtk_entry_get_icon_pixbuf()
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkEntry
3.4.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks: 679538
 
 
Reported: 2012-07-07 05:04 UTC by Andrew Cowie
Modified: 2012-07-09 15:25 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Andrew Cowie 2012-07-07 05:04:18 UTC
With the following sequence (which we're doing in some long-standing this-used-to-work unit tests) the following code crashes GTK 3.4.2

    gtk_entry_set_icon_pixbuf(entry, GTK_ENTRY_ICON_PRIMARY, NULL);
    gtk_entry_get_icon_pixbuf(entry);

should return NULL, but is crashing with G_IS_OBJECT() failing inside g_object_unref(). I checked out that tag from git and the line in question was 7940 of gtk/gtkentry.c:

    /* HACK: unfortunately this is transfer none, so we need to return
     * the icon helper's cache ref directly.
     */
    pixbuf = gtk_entry_ensure_pixbuf (entry, icon_pos);
    g_object_unref (pixbuf);

This code is unchanged in master; the unref is now at line 7949 in gtk/gtkentry.c.

With a comment like that, I'm guessing that something to do the the returned pixbuf not being what it should be, but I'm surprised at g_object_unref() CRITICAL'ing.

Backtrace follows, not that it really matters.

AfC
Comment 1 Andrew Cowie 2012-07-07 05:04:59 UTC
Relevant line is frame 7.

  • #0 raise
    from /lib/x86_64-linux-gnu/libc.so.6
  • #1 abort
    from /lib/x86_64-linux-gnu/libc.so.6
  • #2 g_logv
    at /build/buildd/glib2.0-2.32.3/./glib/gmessages.c line 760
  • #3 g_log
    at /build/buildd/glib2.0-2.32.3/./glib/gmessages.c line 792
  • #4 bindings_java_logging_handler
  • #5 g_logv
    at /build/buildd/glib2.0-2.32.3/./glib/gmessages.c line 733
  • #6 g_log
    at /build/buildd/glib2.0-2.32.3/./glib/gmessages.c line 792
  • #7 gtk_entry_get_icon_pixbuf
    at /build/buildd/gtk+3.0-3.4.2/./gtk/gtkentry.c line 7940
  • #8 Java_org_gnome_gtk_GtkEntry_gtk_1entry_1get_1icon_1pixbuf
    at generated/bindings/org/gnome/gtk/GtkEntry.c line 1279
  • #9 ??
  • #10 ??
  • #11 ??
  • #12 ??
  • #13 ??
  • #14 ??
  • #15 ??
  • #16 ??
  • #17 ??
  • #18 ??

Comment 2 Matthias Clasen 2012-07-08 03:53:39 UTC
Cosimo, this is more iconhelper fallout - can you have a look ?
Comment 3 Cosimo Cecchi 2012-07-08 04:36:11 UTC
Yeah, my bad. I now pushed a fix to git master for this, thanks for the report.
Comment 4 Andrew Cowie 2012-07-09 07:04:06 UTC
Beautiful. Matthias, is this the sort of thing that will backport to the 3.4 series, or should we hack our unit test suite to not do this test case for the next few releases?

AfC
Comment 5 Matthias Clasen 2012-07-09 15:12:36 UTC
If it applies in 3.4, we should cherry-pick it, certainly.
Comment 6 Cosimo Cecchi 2012-07-09 15:25:32 UTC
Cherry-picked to gtk-3-4 now