GNOME Bugzilla – Bug 776472
Crash in gnome-terminal due to gdk_window_process_all_updates calling a GdkDisplayClass vfunc on a display not of that class
Last modified: 2017-04-07 14:52:34 UTC
Created attachment 342455 [details] Terminal_Opened_From_Desktop.png After switching from Xorg to Wayland on Ubuntu GNOME 16.10 with GNOME 3.22 I have found that when I use the right-click menu to open Terminal from the desktop that a window looking like this shows up on the screen for about a second or less: Terminal_Opened_From_Desktop.png And then when it closes all the other Terminal sessions go with it instantly killing anything I've got running from any of the gnome-terminal windows which is really quite annoying and luckily I didn't have anything vital running from one at the time. But this could seriously cause something quite bad for another unsuspecting person. I originally reported this issue here: https://bugs.launchpad.net/ubuntu-gnome/+bug/1652461 But thought I should also do so upstream.
>Dec 24 20:05:27 hostname systemd[1544]: gnome-terminal-server.service: Failed with result 'core-dump'. Looks like the problem is there.
You seem to have some other problems that are probably caused by some ubuntu patch: Dec 24 20:00:03 hostname gnome-terminal-[5061]: Ignoring visual set on widget 'TerminalWindow' that is not on the correct screen. Dec 24 20:00:03 hostname gnome-terminal-[5061]: Ignoring visual set on widget 'TerminalWindow' that is not on the correct screen. Dec 24 20:00:03 hostname gnome-terminal-[5061]: Ignoring visual set on widget 'menubar' that is not on the correct screen. We *need* the stack trace from the crash here to be sure, but I suspect this is https://bugzilla.redhat.com/show_bug.cgi?id=1398958 which is fixed on master and gnome-3-22 branch already.
On the crash a .crash file was created, I have now got Apport to report that crash here: https://bugs.launchpad.net/gnome-terminal/+bug/1652463 However as some private information is contained there Apport has marked it as such and thus only "Trusted" users with that level of access can view it. So unless you have said privileges on LaunchPad I will speak to the people over there?
Please copy all relevant information here; I don't have launchpad access.
I have removed the personal information from the report and made it public, although I am not entirely sure that it was successful in getting the information you want, if not, I will try to get Apport to do it again or try a more manual method.
+ Trace 237023
So it's not https://bugzilla.redhat.com/show_bug.cgi?id=1398958 although I've seen this backtrace on some fedora bug, too. Since it's crashing inside gdk_window_process_all_updates, -> gtk+. Are you sure it's on wayland not xwayland, though? It appears the crash is in X...
Sorry, yes, it does appear to be Xwayland. I'm just rather new to all this with Wayland so maybe I need to do some more reading into the different components etc.
Not a gtk bug, as far as I can see. It crashes inside libx11.
I experience the same issue on Arch. If I select Xorg from GDM on login I have no issues.
https://bugzilla.redhat.com/show_bug.cgi?id=1416125 appears to be the same bug and has a backtrace with a symbol at #0 from wayland:
+ Trace 237083
Thread 1 (Thread 0x7f05cf01ba80 (LWP 22580))
So this does seem wayland related after all.
*** Bug 780578 has been marked as a duplicate of this bug. ***
This is the code in frame #2 of the trace above: https://git.gnome.org/browse/gtk+/tree/gdk/gdkwindow.c?h=gtk-3-22#n4038 static void after_process_all_updates (void) { GSList *displays, *l; GdkDisplayClass *display_class; displays = gdk_display_manager_list_displays (gdk_display_manager_get ()); display_class = GDK_DISPLAY_GET_CLASS (displays->data); for (l = displays; l; l = l->next) display_class->after_process_all_updates (l->data); g_slist_free (displays); } This assumes that every display in the list is of the same class; if there's a display in the list of displays that's not of the same GdkDisplayClass as the first one, this calls the wrong class vfunc! I think what's happening in gnome-terminal is that there's a X11 display and a wayland display in the list. The loop needs to be rewritten to: for (l = displays; l; l = l->next) { GDK_DISPLAY_GET_CLASS (l->data)->after_process_all_updates (l->data); } The function before_process_all_updates() just preceding this code has the same bug.
Assume not needed anymore, but made a 'bt full'
+ Trace 237293
Created attachment 348871 [details] [review] [PATCH] gdkwindow: different displays, different classes GdkWindow's before_process_all_updates() and after_process_all_updates() wrongly assume that all displays are from the same class, which is not the case if for example a client open different displays with different backends such as X11 and Wayland. Use the actual class for each display in the display list to avoid a crash when mixing displays from different classes. Fix suggested by Christian Persch <chpe@gnome.org> in bug #776472.
Review of attachment 348871 [details] [review]: ++
Comment on attachment 348871 [details] [review] [PATCH] gdkwindow: different displays, different classes attachment 348871 [details] [review] pushed to branch gtk-3-22 as commit efbe402 - gdkwindow: different displays, different classes
That doesn't seem to be applicable to master though.
Double checked, did not find any similar case where this would be applicable in gtk+ master currently, so closing now that the fix is in branch gtk-3-22.