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 776472 - Crash in gnome-terminal due to gdk_window_process_all_updates calling a GdkDisplayClass vfunc on a display not of that class
Crash in gnome-terminal due to gdk_window_process_all_updates calling a GdkDi...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.22.x
Other Linux
: High critical
: ---
Assigned To: gtk-bugs
gtk-bugs
: 780578 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2016-12-24 20:41 UTC by Inactive account
Modified: 2017-04-07 14:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Terminal_Opened_From_Desktop.png (28.14 KB, image/png)
2016-12-24 20:41 UTC, Inactive account
  Details
[PATCH] gdkwindow: different displays, different classes (1.83 KB, patch)
2017-03-28 09:16 UTC, Olivier Fourdan
committed Details | Review

Description Inactive account 2016-12-24 20:41:56 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.
Comment 1 Ernestas Kulik 2016-12-24 20:46:18 UTC
>Dec 24 20:05:27 hostname systemd[1544]: gnome-terminal-server.service: Failed with result 'core-dump'.

Looks like the problem is there.
Comment 2 Christian Persch 2016-12-24 21:01:30 UTC
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.
Comment 3 Inactive account 2016-12-26 12:02:20 UTC
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?
Comment 4 Christian Persch 2016-12-26 14:05:35 UTC
Please copy all relevant information here; I don't have launchpad access.
Comment 5 Inactive account 2016-12-28 14:24:57 UTC
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.
Comment 6 Christian Persch 2016-12-28 14:45:18 UTC


  • #0 ??
  • #1 XSync
    from /usr/lib/x86_64-linux-gnu/libX11.so.6
  • #2 gdk_window_process_all_updates
    from /usr/lib/x86_64-linux-gnu/libgdk-3.so.0
  • #3 ??
    from /usr/lib/x86_64-linux-gnu/libvte-2.91.so.0
  • #4 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #5 g_main_context_dispatch
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #6 ??
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #7 g_main_context_iteration
    from /lib/x86_64-linux-gnu/libglib-2.0.so.0
  • #8 g_application_run
    from /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0

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...
Comment 7 Inactive account 2016-12-29 13:52:29 UTC
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.
Comment 8 Matthias Clasen 2016-12-30 15:40:05 UTC
Not a gtk bug, as far as I can see. It crashes inside libx11.
Comment 9 jaz 2017-01-15 01:16:40 UTC
I experience the same issue on Arch. If I select Xorg from GDM on login I have no issues.
Comment 10 Christian Persch′ 2017-01-24 21:11:43 UTC
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:

Thread 1 (Thread 0x7f05cf01ba80 (LWP 22580))

  • #0 wl_display_interface
    from /lib64/libwayland-client.so.0
  • #1 XSync
    at Sync.c line 42
  • #2 after_process_all_updates
    at gdkwindow.c line 4038
  • #3 gdk_window_process_all_updates
    at gdkwindow.c line 4105
  • #4 update_timeout
    at vte.cc line 10710

So this does seem wayland related after all.
Comment 11 Christian Persch 2017-03-27 15:17:32 UTC
*** Bug 780578 has been marked as a duplicate of this bug. ***
Comment 12 Christian Persch 2017-03-27 15:28:40 UTC
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.
Comment 13 Olav Vitters 2017-03-27 16:39:35 UTC
Assume not needed anymore, but made a 'bt full'

  • #0 0x0000000000c65a90 in
  • #1 XSync
    at Sync.c line 42
  • #2 after_process_all_updates
    at gdkwindow.c line 4046
  • #3 gdk_window_process_all_updates
    at gdkwindow.c line 4113
  • #4 update_timeout(gpointer)
    at vte.cc line 10688
  • #5 g_timeout_dispatch
    at gmain.c line 4674
  • #6 g_main_dispatch
    at gmain.c line 3203
  • #7 g_main_context_dispatch
    at gmain.c line 3856
  • #8 g_main_context_iterate
    at gmain.c line 3929
  • #9 g_main_context_iteration
    at gmain.c line 3990
  • #10 g_application_run
    at gapplication.c line 2381
  • #11 main
    at server.c line 180

Comment 14 Olivier Fourdan 2017-03-28 09:16:04 UTC
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.
Comment 15 Matthias Clasen 2017-04-03 16:40:37 UTC
Review of attachment 348871 [details] [review]:

++
Comment 16 Olivier Fourdan 2017-04-03 17:30:21 UTC
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
Comment 17 Olivier Fourdan 2017-04-03 17:33:15 UTC
That doesn't seem to be applicable to master though.
Comment 18 Olivier Fourdan 2017-04-07 14:52:34 UTC
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.