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 732742 - Infinite recursion on GdkDevice disposal
Infinite recursion on GdkDevice disposal
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-07-04 14:34 UTC by Emilio Pozuelo Monfort
Modified: 2015-11-24 19:56 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
device: Fix dispose (1.63 KB, patch)
2015-11-24 19:44 UTC, Carlos Garnacho
committed Details | Review

Description Emilio Pozuelo Monfort 2014-07-04 14:34:01 UTC
Launching a GTK+ app to run on Weston/drm from a different tty than Weston (whether from X11 with GDK_BACKEND=wayland or from a text tty) causes that app to start in Weston as expected, but when you switch to weston, the app crashes immediately. The crash is due to an infinite recursion on gdk_device_dispose():

  • #15 gdk_device_dispose
    at /build/gtk+3.0-lhk9E2/gtk+3.0-3.12.2/./gdk/gdkdevice.c line 278
  • #16 g_object_unref
    at /tmp/buildd/glib2.0-2.40.0/./gobject/gobject.c line 3075
  • #17 _gdk_device_set_associated_device
    at /build/gtk+3.0-lhk9E2/gtk+3.0-3.12.2/./gdk/gdkdevice.c line 980
  • #18 gdk_device_dispose
    at /build/gtk+3.0-lhk9E2/gtk+3.0-3.12.2/./gdk/gdkdevice.c line 278
  • #19 g_object_unref
    at /tmp/buildd/glib2.0-2.40.0/./gobject/gobject.c line 3075
  • #20 _gdk_device_set_associated_device
    at /build/gtk+3.0-lhk9E2/gtk+3.0-3.12.2/./gdk/gdkdevice.c line 980
  • #21 gdk_device_dispose
    at /build/gtk+3.0-lhk9E2/gtk+3.0-3.12.2/./gdk/gdkdevice.c line 278

Comment 1 Carlos Garnacho 2015-11-24 19:44:06 UTC
Created attachment 316198 [details] [review]
device: Fix dispose

The way master devices detach from their other master counterpart is
vulnerable to infinite recursion due to the way we first recurse on
the other device before clearing the pointer, this may happen if
that last reference to the other master device is held by the
device->associated field.
Comment 2 Matthias Clasen 2015-11-24 19:48:58 UTC
Review of attachment 316198 [details] [review]:

ok
Comment 3 Carlos Garnacho 2015-11-24 19:55:56 UTC
Attachment 316198 [details] pushed as cc2e772 - device: Fix dispose