! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfce4-terminal crashes when run under wayland
Status:
RESOLVED: FIXED
Product:
Xfce4-terminal
Component:
General

Comments

Description Kevin Fenzi 2016-08-22 15:30:56 CEST
With the gtk3 xfce4-terminal port, xfce4-terminal no longer works in wayland sessions:

(xfce4-terminal:26573): GLib-GObject-WARNING **: invalid cast from 'GdkWaylandDisplay' to 'GdkX11Display'

Thread 1 "xfce4-terminal" received signal SIGSEGV, Segmentation fault.
0x00007ffff7ad4cca in XSync (dpy=0x5555557c5af0, discard=0) at Sync.c:42
42	    LockDisplay(dpy);
(gdb) where
#0  0x00007ffff7ad4cca in XSync (dpy=0x5555557c5af0, discard=0) at Sync.c:42
#1  0x00007ffff6a451b1 in gdk_window_process_all_updates () from /lib64/libgdk-3.so.0
#2  0x00007ffff7867261 in update_timeout(void*) () from /lib64/libvte-2.91.so.0
#3  0x00007ffff589594d in g_timeout_dispatch () from /lib64/libglib-2.0.so.0
#4  0x00007ffff5894f02 in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#5  0x00007ffff5895280 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#6  0x00007ffff58955a2 in g_main_loop_run () from /lib64/libglib-2.0.so.0
#7  0x00007ffff6f32275 in gtk_main () from /lib64/libgtk-3.so.0
#8  0x0000555555562686 in main ()

Asking a more wayland savvy person: 

"some apps wrongly assume they run in X11 (and would ever do), and cast the GdkDisplay to a GdkX11Display, unfortunately with gtk3 and Wayland, that depends on the backend in use, and in Wayland with gtk3, a GdkDisplay is not a GdkX11Display, too bad for the broken app"

As a workaround you can do: 

GDK_BACKEND=x11 xfce4-terminal

but it would be nice to fix this. :)
Comment 1 Igor editbugs 2016-08-22 15:33:52 CEST
Thanks for the report, Kevin!
Could you please check if other vte-based apps (e.g. gnome-terminal) are running fine?
Comment 2 Kevin Fenzi 2016-08-22 15:44:22 CEST
yes, gnome-terminal works fine.
Comment 3 poma 2016-08-22 20:01:48 CEST
Does it crashes when run under the Mir?
https://unity.ubuntu.com/mir
Comment 4 Kevin Fenzi 2016-08-22 20:48:14 CEST
No idea. I don't have any mir using servers here.
Comment 5 Igor editbugs 2016-08-23 17:12:22 CEST
Does GDK_BACKEND=wayland help?
The terminal is starting fine for me (though producing a warning) if I run `weston` and then `GDK_BACKEND=wayland xfce4-terminal`.
Comment 6 Kevin Fenzi 2016-08-23 19:37:43 CEST
That indeed also works. So, it's something when the backend isn't explicitly specified perhaps. 

to recap, under wayland:

GDK_BACKEND=wayland xfce4-terminal -> works
GDK_BACKEND=x11 xfce4-terminal -> works
xfce4-terminal -> crashes
Comment 8 Igor editbugs 2016-08-24 15:01:03 CEST
Okay, I managed to run pure wayland session (no X, using weston as WM) on my Arch Linux machine, and I saw that xfce4-terminal is running - I think the same way as when specifying GDK_BACKEND=wayland.

Kevin, please confirm whether you are running wayland session within X or having X support installed (modules=xwayland.so in weston.ini).

Apparently, the $GDK_BACKEND variable is not set, and when having multiple backends installed (e.g. X and wayland) X as taken as default which leads to sefgault for some reason.
When there's only 1 backend available, or the backend is explicitly specified, no crash happens.
Comment 9 Kevin Fenzi 2016-08-24 17:28:31 CEST
I'm running a Gnome/Wayland session with Fedora rawhide here, so it's not using weston, it's using mutter/gnome-shell. 

I also have already gotten one downstream bug report from someone with Fedora 24 gnome/wayland: 

https://bugzilla.redhat.com/show_bug.cgi?id=1369594
Comment 10 Igor editbugs 2016-08-24 17:35:26 CEST
(In reply to Kevin Fenzi from comment #9)
> I'm running a Gnome/Wayland session with Fedora rawhide here, so it's not
> using weston, it's using mutter/gnome-shell. 

But you probably have support for x11, right? You wouldn't be able to run x11 apps under wayland, afaik.

> I also have already gotten one downstream bug report from someone with
> Fedora 24 gnome/wayland: 
> 
> https://bugzilla.redhat.com/show_bug.cgi?id=1369594

Thanks for the link. But I think their issues is different from yours:
Thread no. 1 (10 frames)
 #0 XInternAtom at IntAtom.c:174
 #1 gdk_x11_atom_to_xatom_for_display at gdkproperty-x11.c:115
 #2 gdk_x11_screen_supports_net_wm_hint at gdkscreen-x11.c:1754
 #3 terminal_window_init at terminal-window.c:388
 #4 g_type_create_instance at gtype.c:1875
 #5 g_object_new_internal at gobject.c:1781
 #6 g_object_new_valist at gobject.c:2040
 #8 terminal_window_new at terminal-window.c:1895
 #9 terminal_app_create_window at terminal-app.c:334
 #10 terminal_app_open_window at terminal-app.c:685

Anyway, I will prevent the terminal from calling *_wm_hint() under wayland as they seem to make sense for x11 only.
Comment 11 Kevin Fenzi 2016-08-24 18:16:58 CEST
Yeah, there is x11 support indeed. 

Hum, that might still be the same crash as I am seeing, but gdb might be doing something odd. When I look at the crash report, I see: 

https://retrace.fedoraproject.org/faf/reports/1276791/

which is the same as the downstream one. Will poke at gdb some.
Comment 12 poma 2016-08-27 05:29:38 CEST
(In reply to poma from comment #3)
> Does it crashes when run under the Mir?
> https://unity.ubuntu.com/mir

Doing the best it can, as opposed to gnome-terminal,
not a bug 12794
Comment 13 Igor editbugs 2016-08-27 09:34:50 CEST
(In reply to poma from comment #12)
> (In reply to poma from comment #3)
> > Does it crashes when run under the Mir?
> > https://unity.ubuntu.com/mir
> 
> Doing the best it can, as opposed to gnome-terminal,
> not a bug 12794

Thanks for the update!
Comment 14 poma 2016-08-27 19:24:28 CEST
Created attachment 6793 
Xfce Terminal on Wayland

Одна картинка стоит тысячи слов
Comment 15 poma 2016-08-27 21:17:22 CEST
Created attachment 6794 
Xfce Terminal on Xwayland

$ rpm -qi xorg-x11-server-Xwayland | grep Description -A1
Description :
Xwayland is an X server for running X clients under Wayland.

https://wayland.freedesktop.org/xserver.html
Comment 16 poma 2016-08-27 21:18:56 CEST
Created attachment 6795 
Stack traces
Comment 17 poma 2016-08-28 17:03:09 CEST
Created attachment 6797 
backtrace xfce4-terminal-0.7.0.20160826git0cd51a5 Xwayland
Comment 18 Igor editbugs 2016-08-29 15:16:59 CEST
Kevin, poma,
Please try https://git.xfce.org/apps/xfce4-terminal/commit/?id=f1179b70268c7bd5412401e111a2d799f86a2cb6 - it makes the terminal working under Fedora 24 with wayland for me.
Comment 19 poma 2016-08-29 17:29:29 CEST
Created attachment 6800 
Xfce Terminal on Xwayland OK
Comment 20 Igor editbugs 2016-08-29 17:34:25 CEST
(In reply to poma from comment #14)
> Created attachment 6793 
> Xfce Terminal on Wayland
> 
> Одна картинка стоит тысячи слов

In Russian, we say "it's better to see once than hear a hundred times" :)
Comment 21 poma 2016-08-29 17:55:43 CEST
(In reply to Igor from comment #20)
> (In reply to poma from comment #14)
> > Created attachment 6793 
> > Xfce Terminal on Wayland
> > 
> > Одна картинка стоит тысячи слов
> 
> In Russian, we say "it's better to see once than hear a hundred times" :)


Well, blame translate.google.com. ;)
Comment 22 Igor editbugs 2016-08-31 12:51:44 CEST
Version 0.6.91 will contain the fix.
Comment 24 Kevin Fenzi 2016-08-31 18:37:48 CEST
Sorry for the late reply here, but yes, this fixes the issue. ;)
Comment 25 Igor editbugs 2016-08-31 18:38:31 CEST
(In reply to Kevin Fenzi from comment #24)
> Sorry for the late reply here, but yes, this fixes the issue. ;)

Thanks for the update!

Please take 0.6.91 :)

Bug #12785

Reported by:
Kevin Fenzi
Reported on: 2016-08-22
Last modified on: 2016-08-31

People

CC List:
2 users

Version

Version:
0.6.90

Attachments

Xfce Terminal on Wayland (281.34 KB, image/png)
2016-08-27 19:24 CEST , poma
no flags
Xfce Terminal on Xwayland (766.60 KB, image/png)
2016-08-27 21:17 CEST , poma
no flags
Stack traces (4.30 KB, text/plain)
2016-08-27 21:18 CEST , poma
no flags
backtrace xfce4-terminal-0.7.0.20160826git0cd51a5 Xwayland (11.23 KB, text/plain)
2016-08-28 17:03 CEST , poma
no flags
Xfce Terminal on Xwayland OK (343.12 KB, image/png)
2016-08-29 17:29 CEST , poma
no flags

Additional information