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 727021 - Several GTK+ apps crash when running on wayland backend
Several GTK+ apps crash when running on wayland backend
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.12.x
Other Linux
: Normal major
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-03-25 14:29 UTC by Armin K.
Modified: 2014-07-21 07:25 UTC
See Also:
GNOME target: 3.14
GNOME version: ---


Attachments
Evince screenshot (76.59 KB, image/png)
2014-03-25 14:37 UTC, Armin K.
  Details
proposed patch (2.78 KB, patch)
2014-06-12 10:07 UTC, Sjoerd Simons
none Details | Review

Description Armin K. 2014-03-25 14:29:03 UTC
Trying GTK+ apps in Weston right now. I have managed to crash evince and I believe it's something related to GTK+.

Clicking on evince icon that shows drop down menu (see screenshot, it's underlined) will crash when I click on it the second time, ie: Click on it, move mouse away from it and let the menu disappear, click on it again and  the crash happens. So far I have been able to reproduce the crash every time on weston drm and x11 backends.

I have captured the core dump, forgive me for not having all the debug symbols. I can add them if necessary.

(evince:26186): Gdk-ERROR **: wl_surface@22: error 0: desktop_shell::get_shell_surface already requested

rogram received signal SIGTRAP, Trace/breakpoint trap.
g_logv (log_domain=0x7ffff6a17426 "Gdk", log_level=G_LOG_LEVEL_ERROR, 
    format=<optimized out>, args=<optimized out>) at gmessages.c:1038
1038	gmessages.c: No such file or directory.
(gdb) bt
  • #0 g_logv
    at gmessages.c line 1038
  • #1 wl_log
    at src/wayland-util.c line 378
  • #2 display_handle_error
    at src/wayland-client.c line 585
  • #3 ffi_call_unix64
    from /usr/lib/libffi.so.6
  • #4 ffi_call
    from /usr/lib/libffi.so.6
  • #5 wl_closure_invoke
    at src/connection.c line 927
  • #6 dispatch_event
    at src/wayland-client.c line 1058
  • #7 dispatch_queue
    at src/wayland-client.c line 1156
  • #8 wl_display_dispatch_queue
    at src/wayland-client.c line 1347
  • #9 wl_display_dispatch
    at src/wayland-client.c line 1414
  • #10 _gdk_wayland_display_queue_events
    at gdkeventsource.c line 162
  • #11 gdk_display_get_event
    at gdkdisplay.c line 320
  • #12 gdk_event_source_dispatch
    at gdkeventsource.c line 84
  • #13 g_main_dispatch
    at gmain.c line 3064
  • #14 g_main_context_dispatch
    at gmain.c line 3663
  • #15 g_main_context_iterate
    at gmain.c line 3734
  • #16 g_main_context_iteration
    at gmain.c line 3795
  • #17 g_application_run
    at gapplication.c line 2114
  • #18 ??
  • #19 __libc_start_main
    at libc-start.c line 285
  • #20 ??

Comment 1 Armin K. 2014-03-25 14:35:44 UTC
I am able to reproduce this with any program that has some kind of drop down menu

eog
gedit
rhythmbox
totem

glib-2.40.0
atk-2.12.0
cairo-1.12.16
pango-1.36.3
at-spi2-core-2.12.0
at-spi2-atk-2.12.0
gdk-pixbuf-2.30.7
gtk+-3.12.0
wayland-1.4.0-26-g3adcf6f (git master)
weston-1.4.0-109-ge81a175 (git master)
Comment 2 Armin K. 2014-03-25 14:37:48 UTC
Created attachment 272856 [details]
Evince screenshot
Comment 3 Sjoerd Simons 2014-06-12 10:07:40 UTC
Created attachment 278322 [details] [review]
proposed patch

The popup crashes occur as weston throws an error when trying to re-create an xdg surface. This can be solved in weston, but it might make sense to sync the lifetime behaviour of xdg_shell with that of wl_shell_surface. The attached patch uses the assumption that that's the way forward :)

Things i'm unsure about:
  * Interaction with custom surfaces
  * I'm assuming  ->show always gets called before ->process_updates_recurse (either for new windows or 
      after a window has been hidden).

Testing the patch with gtk3-demo revealed now new isseus and fixed the client crashing when opening/closing combo boxes
Comment 4 Sjoerd Simons 2014-07-21 07:25:54 UTC
Curiously it looks like Jasper committed *exactly* the same patch about a week after I posted this one. So i guess this one can be marked as resolved:

commit 87e2a7d4b23e633d0f2263d6ebd205c113eede0f
Author: Jasper St. Pierre <jstpierre@mecheye.net>
Date:   Thu Jun 19 15:04:09 2014 -0400

    gdkwindow-wayland: Destroy the wl_surface too when hiding a window
    
    wl_surfaces can't switch roles, so destroying the xdg_surface but not
    the wl_surface means that we could get an error when trying to re-map
    the surface.
    
    We could fix this by not destroying the xdg resource and only do it at
    finalization time, but it's just as easy to just create a new wl_surface.