Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random crashes when repeatedly moving terminals #143

Closed
dsboger-zz opened this issue Mar 15, 2016 · 12 comments
Closed

Random crashes when repeatedly moving terminals #143

dsboger-zz opened this issue Mar 15, 2016 · 12 comments
Labels

Comments

@dsboger-zz
Copy link
Contributor

I have been able to crash terminix consistently by splitting a few times and then moving terminals around a bit.

@gnunn1
Copy link
Owner

gnunn1 commented Mar 15, 2016

Are you building from source or using the binaries I am providing?

Can you try running terminix using the following command:

G_SLICE=debug-blocks gdb terminix

Once GDB launches, just type run to launch terminix. Reproduce the problem and then go back to gdb and type bt to get a backtrace and post it here.

I might need you to test this with a few builds to narrow down the issue but let's see what the first backtrace looks like.

@dsboger-zz
Copy link
Contributor Author

Backtrace is the same with either terminix (from binary) or terminix-git (from source):

(gdb) run
Starting program: /usr/bin/terminix 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffeb153700 (LWP 6822)]
[New Thread 0x7fffea952700 (LWP 6823)]
[New Thread 0x7fffe89fa700 (LWP 6824)]

Thread 1 "terminix" received signal SIGSEGV, Segmentation fault.
0x000000000081cfdc in gx.terminix.sidebar.SideBar.onButtonPress(gdk.Event.Event, gtk.Widget.Widget)
    ()
(gdb) bt
#0  0x000000000081cfdc in gx.terminix.sidebar.SideBar.onButtonPress(gdk.Event.Event, gtk.Widget.Widget) ()
#1  0x00000000008f75af in gtk.Widget.Widget.callBackButtonPressEventGeneric(gtkc.gtktypes.GtkWidget*, gtkc.gdktypes.GdkEvent*, gtk.Widget.Widget) ()
#2  0x00007fffeda42a3c in ?? () from /usr/lib/libgtk-3.so.0
#3  0x00007ffff100df45 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#4  0x00007ffff101ff91 in ?? () from /usr/lib/libgobject-2.0.so.0
#5  0x00007ffff10287c9 in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0
#6  0x00007ffff102905f in g_signal_emit () from /usr/lib/libgobject-2.0.so.0
#7  0x00007fffedb7ff5c in ?? () from /usr/lib/libgtk-3.so.0
#8  0x00007fffeda3fe9e in ?? () from /usr/lib/libgtk-3.so.0
#9  0x00007fffeda41c4c in gtk_main_do_event () from /usr/lib/libgtk-3.so.0
#10 0x00007ffff05ccd52 in ?? () from /usr/lib/libgdk-3.so.0
#11 0x00007ffff1b41d87 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#12 0x00007ffff1b41fe0 in ?? () from /usr/lib/libglib-2.0.so.0
#13 0x00007ffff1b4208c in g_main_context_iteration () from /usr/lib/libglib-2.0.so.0
#14 0x00007ffff0b0267c in g_application_run () from /usr/lib/libgio-2.0.so.0
#15 0x0000000000849480 in gio.Application.Application.run(immutable(char)[][]) ()
#16 0x00000000007de5a8 in D main ()

@gnunn1
Copy link
Owner

gnunn1 commented Mar 15, 2016

Is the Sidebar showing when the crash happens, kind of weird how it is reporting it there. If the back trace is accurate should be easily fixed with some null checking but I wonder if the mouse grab the sidebar is doing isn't getting released as expected.

If you start Terminix and never open the sidebar is it still reproduceable withe same stack trace?

@dsboger-zz
Copy link
Contributor Author

Never touched the sidebar or the button or had multiple sessions. Just started terminix, split a few times and move terminals around until the crash. Not sure it is related to moving the terminals though, as the instant of the crash seemed random.

@gnunn1
Copy link
Owner

gnunn1 commented Mar 15, 2016

The sidebar does a non-blocking grab of the mouse and keyboard when it is opened so that if you click outside it or press escape it closes up. When closed it releases the grab. It's possible I've screwed something up and it's grabbing focus from the get go so all window input is being sent through it.

You've given me enough to start investigating so thanks very much, I'll work on it tomorrow night.

@dsboger-zz
Copy link
Contributor Author

Just found a simple reproducer here: launch terminix, maximize, split once, click the extreme left of the window/screen. Interestingly it only crashes if split at least once (even if I close the second terminal before clicking).
EDIT: the reproducer generates the same backtrace as before.

@kpocius
Copy link

kpocius commented Mar 15, 2016

I can reproduce the issue without even splitting the screen. Just open terminix and try to select text from the left. As soon as you click, it crashes.

Here's gdb output, though it's exactly the same as @dsboger posted:

(gdb) run
Starting program: /usr/bin/terminix 
Missing separate debuginfos, use: dnf debuginfo-install terminix-0.53.0-4.1.x86_64
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffe41d8700 (LWP 15466)]
[New Thread 0x7fffe39d7700 (LWP 15467)]
[New Thread 0x7fffe1423700 (LWP 15468)]
Detaching after fork from child process 15469.

Program received signal SIGSEGV, Segmentation fault.
0x000000000081cfdc in gx.terminix.sidebar.SideBar.onButtonPress(gdk.Event.Event, gtk.Widget.Widget)
    ()
(gdb) bt
#0  0x000000000081cfdc in gx.terminix.sidebar.SideBar.onButtonPress(gdk.Event.Event, gtk.Widget.Widget) ()
#1  0x00000000008f75af in gtk.Widget.Widget.callBackButtonPressEventGeneric(gtkc.gtktypes.GtkWidget*, gtkc.gdktypes.GdkEvent*, gtk.Widget.Widget) ()
#2  0x00007fffed9faeec in _gtk_marshal_BOOLEAN__BOXED () from /lib64/libgtk-3.so.0
#3  0x00007ffff14617a5 in g_closure_invoke () from /lib64/libgobject-2.0.so.0
#4  0x00007ffff1473851 in signal_emit_unlocked_R () from /lib64/libgobject-2.0.so.0
#5  0x00007ffff147c122 in g_signal_emit_valist () from /lib64/libgobject-2.0.so.0
#6  0x00007ffff147c8ff in g_signal_emit () from /lib64/libgobject-2.0.so.0
#7  0x00007fffedb384bc in gtk_widget_event_internal () from /lib64/libgtk-3.so.0
#8  0x00007fffed9f834e in propagate_event () from /lib64/libgtk-3.so.0
#9  0x00007fffed9fa0fc in gtk_main_do_event () from /lib64/libgtk-3.so.0
#10 0x00007ffff0a1be92 in gdk_event_source_dispatch () from /lib64/libgdk-3.so.0
#11 0x00007ffff18f1e3a in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
#12 0x00007ffff18f21d0 in g_main_context_iterate.isra () from /lib64/libglib-2.0.so.0
#13 0x00007ffff18f227c in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#14 0x00007ffff0f55a0c in g_application_run () from /lib64/libgio-2.0.so.0
#15 0x0000000000849480 in gio.Application.Application.run(immutable(char)[][]) ()
#16 0x00000000007de5a8 in D main ()
(gdb) 

Fedora 23, terminix-0.53.0-4.1.x86_64 (installed using provided RPM).

gnunn1 added a commit that referenced this issue Mar 15, 2016
@gnunn1
Copy link
Owner

gnunn1 commented Mar 15, 2016

I'm able to reproduce using @dsboger excellent instructions and have checked in a fix. On my system it looks like the sidebar gets the onbuttonpress when you click the very left edge even though it's technically not visible, I guess the GtkRevealer widget must maintain a 1 pixel grab area or something similar. Anyway, adding a null check seems to have fixed the issue.

Can someone build from source and test this to confirm it is fixed please.

@dsboger-zz
Copy link
Contributor Author

I've tried everything I did before and no crash. Looks good to me.

@gnunn1
Copy link
Owner

gnunn1 commented Mar 15, 2016

Thanks, really appreciate your help with identifying and testing this issue.

@kpocius
Copy link

kpocius commented Mar 15, 2016

Not sure if this is a proper fix - while it doesn't crash any longer, I cannot select the first two characters of the output from the left.

Should I open another issue for this?

@kpocius
Copy link

kpocius commented Mar 16, 2016

Please disregard my comment above. It got fixed along with #142

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants