gnunn1 / tilix

A tiling terminal emulator for Linux using GTK+ 3
https://gnunn1.github.io/tilix-web
Mozilla Public License 2.0
5.41k stars 293 forks source link

Tilix crashes when you click the title on headerbar #1198

Closed alex285 closed 6 years ago

alex285 commented 6 years ago

to reproduce

  1. Open Tilix
  2. Click on "Title" to edit it

on Arch build from master

Versions Tilix version: 1.7.1 VTE version: 0.50 GTK Version: 3.22.26

on a sidenote, Tilix sometimes crashes on autocompletions {on tab} but i cant always reproduce and catch the error

(gdb) run
Starting program: /home/alex/Git/Apps/tilix/tilix 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffebf88700 (LWP 22888)]
[New Thread 0x7fffeb787700 (LWP 22889)]
[New Thread 0x7fffe98ff700 (LWP 22890)]
[New Thread 0x7fffe8c04700 (LWP 22891)]
[New Thread 0x7fffdbfff700 (LWP 22892)]

(tilix:22884): GLib-GObject-WARNING **: g_object_remove_toggle_ref: couldn't find toggle ref 0x555555e54ad4(0x7fffffffd1c0)
[Thread 0x7fffe8c04700 (LWP 22891) exited]

Thread 1 "tilix" received signal SIGSEGV, Segmentation fault.
0x0000555556596530 in gdk_x11_get_server_time ()
(gdb) bt
#0  0x0000555556596530 in gdk_x11_get_server_time ()
#1  0x00007fffefbe4b6b in  () at /usr/lib/libgtk-3.so.0
#2  0x00007fffefbe4c36 in  () at /usr/lib/libgtk-3.so.0
#3  0x00007fffefbe5536 in gtk_clipboard_set_with_owner ()
    at /usr/lib/libgtk-3.so.0
#4  0x00007fffef9d6741 in  () at /usr/lib/libgtk-3.so.0
#5  0x00007fffef9d8c5f in  () at /usr/lib/libgtk-3.so.0
#6  0x00007ffff2deac01 in g_signal_emit_valist ()
    at /usr/lib/libgobject-2.0.so.0
#7  0x00007ffff2deb920 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#8  0x00007fffefbbf24c in gtk_widget_grab_focus () at /usr/lib/libgtk-3.so.0
#9  0x0000555555eb682e in _D3gtk6WidgetQh9grabFocusMFZv ()
#10 0x0000555555d8a07f in _D2gx5tilix11customtitle11CustomTitle11setViewModeMFEQBzQBzQBwQBm8ViewModeZv ()
#11 0x0000555555d8a159 in gx.tilix.customtitle.CustomTitle.doEdit() ()
#12 0x0000555555d8a24a in _D2gx5tilix11customtitle11CustomTitle15timeoutCallbackUCQCcQCcQBzQBpZb ()
#13 0x00007ffff443ecb3 in  () at /usr/lib/libglib-2.0.so.0
#14 0x00007ffff44400be in g_main_context_dispatch ()
    at /usr/lib/libglib-2.0.so.0
#15 0x00007ffff4441f69 in  () at /usr/lib/libglib-2.0.so.0
#16 0x00007ffff4441fae in g_main_context_iteration ()
    at /usr/lib/libglib-2.0.so.0
---Type <return> to continue, or q <return> to quit---
#17 0x00007ffff30535ae in g_application_run () at /usr/lib/libgio-2.0.so.0
#18 0x0000555555e03ac3 in _D3gio11ApplicationQn3runMFAAyaZi ()
#19 0x0000555555cde8ba in D main ()
gnunn1 commented 6 years ago

I can reproduce this, I'll have a look.

gnunn1 commented 6 years ago

This looks like a bug in GTK to me:

#0  0x0000555556548300 in gdk_x11_get_server_time ()
#1  0x00007fffef463b6b in  () at /usr/lib/libgtk-3.so.0
#2  0x00007fffef463c36 in  () at /usr/lib/libgtk-3.so.0
#3  0x00007fffef464536 in gtk_clipboard_set_with_owner () at /usr/lib/libgtk-3.so.0
#4  0x00007fffef255741 in  () at /usr/lib/libgtk-3.so.0
#5  0x00007fffef257c5f in  () at /usr/lib/libgtk-3.so.0
#6  0x00007ffff2669c01 in g_signal_emit_valist () at /usr/lib/libgobject-2.0.so.0
#7  0x00007ffff266a920 in g_signal_emit () at /usr/lib/libgobject-2.0.so.0
#8  0x00007fffef43e24c in gtk_widget_grab_focus () at /usr/lib/libgtk-3.so.0
#9  0x0000555555f25f82 in _D3gtk6WidgetQh9grabFocusMFZv (this=0x7ffff7ec9800)
    at ../../../.dub/packages/gtk-d-3.7.1/gtk-d/generated/gtkd/gtk/Widget.d:3531
#10 0x0000555555dda815 in _D2gx5tilix11customtitle11CustomTitle11setViewModeMFEQBzQBzQBwQBm8ViewModeZv (this=0x7ffff7ec7000, mode=<incomplete type>) at source/gx/tilix/customtitle.d:168
#11 0x0000555555dda901 in gx.tilix.customtitle.CustomTitle.doEdit() (this=0x7ffff7ec7000) at source/gx/tilix/customtitle.d:184
#12 0x0000555555ddaa1e in _D2gx5tilix11customtitle11CustomTitle15timeoutCallbackUCQCcQCcQBzQBpZb (ct=0x7ffff7ec7000)
    at source/gx/tilix/customtitle.d:206
#13 0x00007ffff3cbdcb3 in  () at /usr/lib/libglib-2.0.so.0
#14 0x00007ffff3cbf0be in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#15 0x00007ffff3cc0f69 in  () at /usr/lib/libglib-2.0.so.0
#16 0x00007ffff3cc0fae in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#17 0x00007ffff28d25ae in g_application_run () at /usr/lib/libgio-2.0.so.0
#18 0x0000555555e5fdd6 in _D3gio11ApplicationQn3runMFAAyaZi (this=0x7ffff7edc800, argv=...)
    at ../../../.dub/packages/gtk-d-3.7.1/gtk-d/generated/gtkd/gio/Application.d:931
gnunn1 commented 6 years ago

Bug opened with GTK: https://bugzilla.gnome.org/show_bug.cgi?id=790822

triplejam commented 6 years ago

It also is crashing for me when exiting out of preferences. Using same versions as @alex285

pgkos commented 6 years ago

The bug occurs for me when building using the following commands (on Arch Linux, the same commands as in the PKGBUILD of the AUR tilix package):

git clone https://github.com/gnunn1/tilix.git
cd tilix
./autogen.sh
./configure --prefix=/usr PO4A_TRANS=/usr/bin/vendor_perl/po4a-translate
make DC='ldmd' DCFLAGS='-O -inline -release -version=StdLoggerDisableTrace'
./tilix

But, when building using dub, the bug does not occur. I have to remove "-defaultlib=:libphobos2-ldc.a,:libdruntime-ldc.a" from dflags-ldc in dub.json before building, else it does not compile.

git clone https://github.com/gnunn1/tilix.git
cd tilix
dub build --compiler=ldc2
./tilix
gnunn1 commented 6 years ago

Consolidating in #1192