lanoxx / tilda

A Gtk based drop down terminal for Linux and Unix
GNU General Public License v2.0
1.28k stars 161 forks source link

Tilda crashes when trying to start under Wayland #314

Closed sdague closed 4 years ago

sdague commented 7 years ago

I just upgraded my laptop to Ubuntu 17.10 rc1, and found that tilda crashes on start. I did a dpkg-buildpackage under the assumption the crash might be bad library linkage, but it still crashed after that. Here is the crash running under gdb.

(gdb) file /usr/bin/tilda Reading symbols from /usr/bin/tilda...Reading symbols from /usr/lib/debug/.build-id/d4/9a95622c52dfe299ba856f00296e13be52e178.debug...done. done. (gdb) run Starting program: /usr/bin/tilda tilda [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". [New Thread 0x7fffea9ee700 (LWP 22765)] [New Thread 0x7fffea1ed700 (LWP 22766)] [New Thread 0x7fffe99ec700 (LWP 22767)] [New Thread 0x7fffdbfff700 (LWP 22768)] [New Thread 0x7fffdb7fe700 (LWP 22769)] [New Thread 0x7fffdaffd700 (LWP 22772)] [New Thread 0x7fffda7fc700 (LWP 22773)] [New Thread 0x7fffd9ffb700 (LWP 22774)]

(tilda:22759): Vte-WARNING *: (/build/vte2.91-C4Ziqn/vte2.91-0.48.4/./src/vtegtk.cc:1736):int vte_terminal_match_add_gregex(VteTerminal, GRegex*, GRegexMatchFlags): runtime check failed: (g_regex_get_compile_flags(gregex) & G_REGEX_MULTILINE) [xcb] Extra reply data still left in queue [xcb] This is most likely caused by a broken X extension library [xcb] Aborting, sorry about that. tilda: ../../src/xcb_io.c:568: _XReply: Assertion `!xcb_xlib_extra_reply_data_left' failed.

Thread 1 "tilda" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51 51 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.

(gdb) bt

0 0x00007ffff56df0bb in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51

1 0x00007ffff56e0f5d in __GI_abort () at abort.c:90

2 0x00007ffff56d6f17 in __assert_fail_base (fmt=, assertion=assertion@entry=0x7ffff5d56820 "!xcb_xlib_extra_reply_data_left", file=file@entry=0x7ffff5d564cb "../../src/xcb_io.c", line=line@entry=568, function=function@entry=0x7ffff5d568d8 "_XReply") at assert.c:92

3 0x00007ffff56d6fc2 in __GI___assert_fail (assertion=0x7ffff5d56820 "!xcb_xlib_extra_reply_data_left", file=0x7ffff5d564cb "../../src/xcb_io.c", line=568, function=0x7ffff5d568d8 "_XReply") at assert.c:101

4 0x00007ffff5ce4df4 in _XReply () at /usr/lib/x86_64-linux-gnu/libX11.so.6

5 0x00007ffff5cd345f in XGetModifierMapping () at /usr/lib/x86_64-linux-gnu/libX11.so.6

6 0x000055555555fc1a in reload_modmap (modmap=0x555555fa03e0, keymap=0x5555557e8180) at src/eggaccelerators.c:456

7 0x000055555555fc1a in egg_keymap_get_modmap (keymap=0x5555557e8180) at src/eggaccelerators.c:547

8 0x000055555555fe60 in egg_keymap_resolve_virtual_modifiers (keymap=0x5555557e8180, virtual_mods=EGG_VIRTUAL_LOCK_MASK, concrete_mods=0x55555577d584 )

at src/eggaccelerators.c:390

9 0x0000555555564bf5 in lookup_ignorable_modifiers (keymap=0x5555557e8180) at src/tomboykeybinder.c:51

10 0x0000555555564fce in tomboy_keybinder_init () at src/tomboykeybinder.c:238

11 0x000055555555e5d2 in main (argc=, argv=) at src/tilda.c:758

I'm happy to provide other info

egmontkob commented 7 years ago

I can confirm that it crashes for me on Wayland. It works on Xorg.

(Up to date Ubuntu 17.10 beta, that is, pretty much final.)

sdague commented 7 years ago

Seems related to #150 ... if the answer is that doesn't work on Wayland, tilda is about to become not usable for all the Ubuntu users with the 17.10 switch.

wrhansen commented 7 years ago

Just ran into this issue myself with an upgrade to 17.10. It's a real shame because tilda is one of my favorite apps!

wrhansen commented 7 years ago

For Ubuntu 17.10 users, you can still use it with Xorg. If you hit the gear icon at the login screen there's an option to run Ubuntu with Xorg. Then tilda works!

ndmax commented 7 years ago

The hurdles here are not trivial, but it's still one of the most lamentable casualties of the Wayland migration in Atrful. For me nothing comes close to the fluid utility of Tilda. To what are others migrating?

egmontkob commented 7 years ago

I'm not a Tilda user, I'd probably mostly miss xmag and xzoom, maybe a few others. I guess I'll stay with X11 as long as I reasonably can, probably at least another 2-3 years. Who knows what happens until then.

lanoxx commented 6 years ago

I simply do not have the time to port tilda to wayland and I also do not have the required experience with wayland to even know where to get started. If someone writes a patch and shows a working version of tilda then thats a starting point and we can look into way of supporting Wayland alongside Xorg. In the meantime tilda will be Xorg only.

sdague commented 6 years ago

@ndmax I started using guake, it's not quite as nice as tilda, but doable. Though given that things like OBS don't work with wayland either (there is no way to capture other screen inputs), I might just fully revert to Xorg rendering.

egmontkob commented 6 years ago

Does guake work on Wayland? I'd be surprised. Doesn't work for me. If it works, though, tilda could study what it's doing.

Note that nowadays guake is pretty much the only vte-based app that still uses the ancient and unmaintained vte-0.28 based on GTK+-2, containing hundreds of bugs that have been fixed since. As such, until they catch up and create a stable GTK+-3-based release, I personally wouldn't recommend guake to anyone.

sdague commented 6 years ago

guake works fine in Wayland. No idea if Ubuntu patched vte to make it work or not, but out of the box for me with Ubuntu 17.10 it just started and all was good.

lanoxx commented 6 years ago

Interesting, can someone point out a change or commit in the guake code made this possible? Are they using some sort of X wrapper ontop of wayland?

egmontkob commented 6 years ago

Correcting myself: guake does start up correctly (as a daemon) and a subsequent guake -t opens its window. Registering the global F12 shortcut doesn't work though, Wayland allegedly not allowing global keys is probably the biggest obstacle to overcome somehow.

Given that they are like 5-6 years behind with GTK+ and VTE, I doubt they have introduced Wayland-specific code. Apps that aren't fully native Wayland automatically use some X11-compatibility layer (called XWayland if I know correctly), and apparently absolute positioning of windows is still possible with this layer (e.g. xterm -geometry +100+100 works while gnome-terminal --geometry +100+100 doesn't).

The difference is probably that guake being a GTK+-2 app, it's sure not native Wayland and hence this X11-compat layer kicks in. tilda might be a fully Wayland app, I don't know, or it just uses something that this compat layer doesn't support properly.

sdague commented 6 years ago

No, the global hotkeys are working fine. F12 works out of the box, though I rebind it to F1 (which I've been using as my tilda hotkey for years). Again, I'm not sure how they do it, but the hotkey does work.

lanoxx commented 6 years ago

@egmontkob if binding of a global hotkey does not work, then thats mostly a sign that some other application is already bound to that hotkey and the application such as guake fails to grab it via the Xorg APIs because the grab never reaches guake (or tilda).

egmontkob commented 6 years ago

Well, I've read somewhere that global hotkeys don't exist in Wayland (wasn't it here in tilda's issue tracker?) but that could've been false information, sorry in that case.

lanoxx commented 6 years ago

Thanks to the pointer that guake is working on wayland I just made some progress. Tilda can be started with the following option:

GDK_BACKEND=x11 tilda

Unfortunately non of the configured hotkeys which I tried reached tilda. So I had to try several times to confirm that tilda was actually starting, in the end I positioned the tilda window somewhere in the center of the screen and disabled the start hidden option from the config file. Now I can see tilda, I can even hide it with the global hotkey, but I have found no way to make is show again once it has been hidden.

Regarding global hotkeys. As far as I know Wayland does not support to register global hotkeys. If the application runs in an XWayland context then thats different, but for pure Wayland applications that will not work.

lanoxx commented 6 years ago

This issue discusses a workaround to get keybindings working for guake https://github.com/Guake/guake/issues/492 can someone check if this workaround comes by default with the guake package?

medv commented 6 years ago

@lanoxx option works, but not if entered as a startup application under 17.10 (so a terminal instance must first be launched, command ran, and terminal window hidden for the duration of the session, no issue with F1 global hotkey).

ndmax commented 6 years ago

It looks like Ubuntu 18.04 is going to switch back to Xorg as default.

Popyllol commented 6 years ago

Still the same in Ubuntu 18.04

$ dpkg -l xwayland
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  xwayland       2:1.19.6-1ub amd64        Xwayland X server
$ gdb /usr/bin/Xwayland core
GNU gdb (Ubuntu 8.1-0ubuntu2) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/bin/Xwayland...(no debugging symbols found)...done.
[New LWP 8042]
[New LWP 8043]
[New LWP 8044]
[New LWP 8046]
[New LWP 8045]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `/usr/bin/Xwayland :0 -rootless -terminate -accessx -core -listen 4 -listen 5 -d'.
Program terminated with signal SIGABRT, Aborted.
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51  ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
[Current thread is 1 (Thread 0x7f331027fa40 (LWP 8042))]
(gdb) bt
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f330d287801 in __GI_abort () at abort.c:79
#2  0x0000564e4b5843ba in OsAbort ()
#3  0x0000564e4b589ed3 in ?? ()
#4  0x0000564e4b58acf5 in FatalError ()
#5  0x0000564e4b41047f in ?? ()
#6  0x0000564e4b581f31 in ?? ()
#7  0x0000564e4b57af3b in WaitForSomething ()
#8  0x0000564e4b546c73 in ?? ()
#9  0x0000564e4b54af10 in ?? ()
#10 0x00007f330d268b97 in __libc_start_main (main=0x564e4b40faa0, argc=12, 
    argv=0x7fff01cd27e8, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fff01cd27d8)
    at ../csu/libc-start.c:310
#11 0x0000564e4b40fada in _start ()
hoellen commented 6 years ago

I just made a PR (#345) to workaround the crash. But their is still an issue with the hotkey (see description).

lanoxx commented 4 years ago

Tilda is still not fully supported under wayland, but the fix from pull request #345 has been merged and will be in tilda 1.5.