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 782283 - Wayland: Crash when dismissing a menu when a tooltip is visible
Wayland: Crash when dismissing a menu when a tooltip is visible
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-05-07 09:56 UTC by Timm Bäder
Modified: 2017-06-02 13:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[PATCH] wayland: check parent surface for subsurface (1.46 KB, patch)
2017-05-16 14:59 UTC, Olivier Fourdan
committed Details | Review

Description Timm Bäder 2017-05-07 09:56:07 UTC
1) In the widget factory, right-click on the GtkLinkButton labeled "link button"). This opens a GtkMenu.
2) Now, with the menu open, hover the menu button again. A tooltip shows up.
3) Press escape
4) The widget-factory now crashes

This bug is present both in the current 3.22 release and master.

Backtrace:

  • #0 raise
    from /usr/lib/libc.so.6
  • #1 abort
    from /usr/lib/libc.so.6
  • #2 wl_abort
    at /home/baedert/Source/gnome/wayland/src/wayland-util.c line 419
  • #3 wl_proxy_marshal_array_constructor_versioned
    at /home/baedert/Source/gnome/wayland/src/wayland-client.c line 653
  • #4 wl_proxy_marshal_array_constructor
    at /home/baedert/Source/gnome/wayland/src/wayland-client.c line 599
  • #5 wl_proxy_marshal_constructor
    at /home/baedert/Source/gnome/wayland/src/wayland-client.c line 733
  • #6 wl_subcompositor_get_subsurface.lto_priv.826
    at /home/baedert/Source/gnome-configure/include/wayland-client-protocol.h line 5376
  • #7 gdk_wayland_window_create_subsurface
    at gdkwindow-wayland.c line 1313
  • #8 gdk_wayland_window_set_transient_for
    at gdkwindow-wayland.c line 3142
  • #9 gdk_window_set_transient_for
    at gdkwindow.c line 8068
  • #10 gtk_window_transient_parent_realized
    at gtkwindow.c line 3107
  • #11 gtk_window_set_transient_for
    at gtkwindow.c line 3233
  • #12 gtk_tooltip_set_last_window
    at gtktooltip.c line 779
  • #13 gtk_tooltip_handle_event_internal
    at gtktooltip.c line 1402
  • #14 _gtk_tooltip_handle_event
    at gtktooltip.c line 1384
  • #15 gtk_main_do_event
    at gtkmain.c line 1607
  • #16 _gdk_event_emit
    at gdkevents.c line 73
  • #17 gdk_event_source_dispatch.lto_priv.9244
    at gdkeventsource.c line 121
  • #18 g_main_dispatch.lto_priv.1040
    at /home/baedert/Source/gnome/glib/glib/gmain.c line 3234
  • #19 g_main_context_dispatch
    at /home/baedert/Source/gnome/glib/glib/gmain.c line 3899
  • #20 g_main_context_iterate
    at /home/baedert/Source/gnome/glib/glib/gmain.c line 3972
  • #21 g_main_context_iteration
    at /home/baedert/Source/gnome/glib/glib/gmain.c line 4033
  • #22 g_application_run
    at /home/baedert/Source/gnome/glib/gio/gapplication.c line 2381
  • #23 main
    at widget-factory.c line 1958

Comment 1 Olivier Fourdan 2017-05-16 14:59:08 UTC
Created attachment 351976 [details] [review]
[PATCH] wayland: check parent surface for subsurface

When an event is received while a tooltip is showing, the GtkTooltip's
event handling code can end up calling gdk_window_set_transient_for()
from gtk_tooltip_set_last_window().

The Wayland GDK backend will try to automatically create a subsurface
in gdk_wayland_window_set_transient_for() but if the parent surface is
gone meanwhile, this will will cause a crash when trying to create a
subsurface from a parent with a null surface.

Checking for the parent is not sufficient, we ought to check for the
parent surface as well to avoid the crash.
Comment 2 Olivier Fourdan 2017-06-01 12:50:09 UTC
Anyone to do a review of attachment 351976 [details] [review] please? Jonas maybe?
Comment 3 Jonas Ådahl 2017-06-02 01:40:43 UTC
Review of attachment 351976 [details] [review]:

Makes sense.
Comment 4 Olivier Fourdan 2017-06-02 13:49:57 UTC
Comment on attachment 351976 [details] [review]
[PATCH] wayland: check parent surface for subsurface

attachment 351976 [details] [review] pushed to git master as commit 08aade4 - wayland: check parent surface for subsurface

attachment 351976 [details] [review] pushed to branch gtk-3-22 as commit c94f40b - wayland: check parent surface for subsurface