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

Crash when opening settings then create a new tab #873

Closed
tito opened this issue Sep 6, 2018 · 6 comments
Closed

Crash when opening settings then create a new tab #873

tito opened this issue Sep 6, 2018 · 6 comments

Comments

@tito
Copy link

tito commented Sep 6, 2018

Version: kitty 0.12.0 created by Kovid Goyal (installed from arch community repo)
To reproduce, open kitty, ctrl+alt+f2, let the config window open, back to the main kitty window, ctrl+alt+t => crash.

Here is the gdb backtrace:

(gdb) bt
#0  0x00007ffff01e7884 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#1  0x00007fffefe9b72a in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#2  0x00007fffefd627bb in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#3  0x00007fffefd600e7 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#4  0x00007ffff01ab2c3 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#5  0x00007ffff01ac04c in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#6  0x00007ffff01b25fd in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#7  0x00007fffefd73373 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#8  0x00007ffff69f363d in ?? () from /usr/bin/../lib/kitty/kitty/fast_data_types.so
#9  0x00007ffff7b63061 in _PyMethodDef_RawFastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#10 0x00007ffff7b8fc6f in _PyMethodDescr_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#11 0x00007ffff7bd8aee in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#12 0x00007ffff7b627db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#13 0x00007ffff7bd43cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#14 0x00007ffff7b627db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#15 0x00007ffff7bd43cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#16 0x00007ffff7b627db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#17 0x00007ffff7bd43cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#18 0x00007ffff7b627db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#19 0x00007ffff7bd43cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#20 0x00007ffff7b627db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#21 0x00007ffff7bd43cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#22 0x00007ffff7b1b069 in _PyEval_EvalCodeWithName () from /usr/lib/libpython3.7m.so.1.0
#23 0x00007ffff7b1bf34 in PyEval_EvalCodeEx () from /usr/lib/libpython3.7m.so.1.0
#24 0x00007ffff7b1bf5c in PyEval_EvalCode () from /usr/lib/libpython3.7m.so.1.0
#25 0x00007ffff7be7b5d in ?? () from /usr/lib/libpython3.7m.so.1.0
#26 0x00007ffff7b62ff3 in _PyMethodDef_RawFastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#27 0x00007ffff7b63201 in _PyCFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#28 0x00007ffff7bd87b4 in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#29 0x00007ffff7b1b069 in _PyEval_EvalCodeWithName () from /usr/lib/libpython3.7m.so.1.0
#30 0x00007ffff7b62982 in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#31 0x00007ffff7bd43cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#32 0x00007ffff7b1b069 in _PyEval_EvalCodeWithName () from /usr/lib/libpython3.7m.so.1.0
#33 0x00007ffff7b1c268 in _PyFunction_FastCallDict () from /usr/lib/libpython3.7m.so.1.0
#34 0x00007ffff7c4e8e7 in ?? () from /usr/lib/libpython3.7m.so.1.0
#35 0x00007ffff7c4ffdb in ?? () from /usr/lib/libpython3.7m.so.1.0
#36 0x00007ffff7ae6a42 in Py_Main () from /usr/lib/libpython3.7m.so.1.0
#37 0x00005555555551ae in main ()
@kovidgoyal
Copy link
Owner

Does not crash on my arch system with those steps (AMD and intel cards). From the backtrace the crash appears to be happening inside the nvidia gl driver, not kitty. Not much I can do about that as I dont have any nvidia graphics cards. You can try using an alternate graphics driver, such as the open source nouveau driver. Other than that I dont have any suggestions, sorry.

It might help if you build kitty in debug mode with make debug and post the backtrace, that way I can at least know what kitty was doing before the driver crashed.

@tito
Copy link
Author

tito commented Sep 6, 2018

So i cloned and recompiled in debug mode. Here is more information:

(gdb) r
Starting program: /usr/bin/python __main__.py
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffeea36700 (LWP 10024)]

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff030f884 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
(gdb) bt
#0  0x00007ffff030f884 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#1  0x00007fffeffc372a in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#2  0x00007fffefe8a7bb in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#3  0x00007fffefe880e7 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#4  0x00007ffff02d32c3 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#5  0x00007ffff02d404c in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#6  0x00007ffff02da5fd in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#7  0x00007fffefe9b373 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#8  0x00007ffff69ebb49 in draw_borders (vao_idx=9, num_border_rects=2, rect_buf=<optimized out>, rect_data_is_dirty=<optimized out>, 
    viewport_width=1090, viewport_height=669, active_window_bg=1910060, num_visible_windows=1, w=0x5555599afab0)
    at /home/tito/code/kitty/kitty/shaders.c:542
#9  0x00007ffff6a50bf4 in render_os_window (num_visible_windows=1, active_window_bg=1910060, active_window_id=3, now=104373.583091229, 
    os_window=0x5555599afab0) at /home/tito/code/kitty/kitty/child-monitor.c:604
#10 render (now=104373.583091229) at /home/tito/code/kitty/kitty/child-monitor.c:651
#11 main_loop (self=0x7ffff3e3f2d0, a=<optimized out>) at /home/tito/code/kitty/kitty/child-monitor.c:776
#12 0x00007ffff797e061 in _PyMethodDef_RawFastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#13 0x00007ffff79aac6f in _PyMethodDescr_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#14 0x00007ffff79f3aee in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#15 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#16 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#17 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#18 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#19 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#20 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#21 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#22 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#23 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#24 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#25 0x00007ffff7936069 in _PyEval_EvalCodeWithName () from /usr/lib/libpython3.7m.so.1.0
#26 0x00007ffff7936f34 in PyEval_EvalCodeEx () from /usr/lib/libpython3.7m.so.1.0
#27 0x00007ffff7936f5c in PyEval_EvalCode () from /usr/lib/libpython3.7m.so.1.0
#28 0x00007ffff7a65770 in ?? () from /usr/lib/libpython3.7m.so.1.0
#29 0x00007ffff7a6754a in PyRun_FileExFlags () from /usr/lib/libpython3.7m.so.1.0
#30 0x00007ffff7a68ac5 in PyRun_SimpleFileExFlags () from /usr/lib/libpython3.7m.so.1.0
#31 0x00007ffff7a6aa8f in ?? () from /usr/lib/libpython3.7m.so.1.0
#32 0x00007ffff7a6b420 in _Py_UnixMain () from /usr/lib/libpython3.7m.so.1.0
#33 0x00007ffff7dc6223 in __libc_start_main () from /usr/lib/libc.so.6
#34 0x000055555555477a in _start ()

And at frame 8:

#8  0x00007ffff69ebb49 in draw_borders (vao_idx=9, num_border_rects=2, rect_buf=<optimized out>, rect_data_is_dirty=<optimized out>, 
    viewport_width=1090, viewport_height=669, active_window_bg=1910060, num_visible_windows=1, w=0x5555599afab0)
    at /home/tito/code/kitty/kitty/shaders.c:542
542             glDrawArraysInstanced(GL_TRIANGLE_FAN, 0, 4, num_border_rects);

@tito
Copy link
Author

tito commented Sep 6, 2018

Actually, if i create multiple windows (from ctrl+alt+n), i can create tabs in the childs, but not on the master window, it crashes. I can share the apitrace dump in you need. Even apitrace crash itself when executing this function at some point.

@kovidgoyal
Copy link
Owner

You can use the --debug-gl command line argument which will report any errors generated by the opengl drivers.

@tito
Copy link
Author

tito commented Sep 6, 2018

Just executed, no error, just plain segfault. Stack didn't changed, just frame 8 is now the wrapper:

(gdb) r
Starting program: /usr/bin/python __main__.py --debug-gl
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
GL version string: '3.3.0 NVIDIA 396.54' Detected version: 3.3
[New Thread 0x7fffeea36700 (LWP 18234)]

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007ffff030f884 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
(gdb) bt
#0  0x00007ffff030f884 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#1  0x00007fffeffc372a in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#2  0x00007fffefe8a7bb in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#3  0x00007fffefe880e7 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#4  0x00007ffff02d32c3 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#5  0x00007ffff02d404c in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#6  0x00007ffff02da5fd in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#7  0x00007fffefe9b373 in ?? () from /usr/lib/libnvidia-glcore.so.396.54
#8  0x00007ffff6a15a15 in glad_debug_impl_glDrawArraysInstanced (arg0=6, arg1=0, arg2=4, arg3=2) at /home/tito/code/kitty/kitty/gl-wrapper.c:2532
#9  0x00007ffff69ebb49 in draw_borders (vao_idx=9, num_border_rects=2, rect_buf=<optimized out>, rect_data_is_dirty=<optimized out>, 
    viewport_width=1090, viewport_height=669, active_window_bg=1910060, num_visible_windows=1, w=0x5555595d6ed0)
    at /home/tito/code/kitty/kitty/shaders.c:542
#10 0x00007ffff6a50bf4 in render_os_window (num_visible_windows=1, active_window_bg=1910060, active_window_id=3, now=106158.970148395, 
    os_window=0x5555595d6ed0) at /home/tito/code/kitty/kitty/child-monitor.c:604
#11 render (now=106158.970148395) at /home/tito/code/kitty/kitty/child-monitor.c:651
#12 main_loop (self=0x7ffff3e3f2d0, a=<optimized out>) at /home/tito/code/kitty/kitty/child-monitor.c:776
#13 0x00007ffff797e061 in _PyMethodDef_RawFastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#14 0x00007ffff79aac6f in _PyMethodDescr_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#15 0x00007ffff79f3aee in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#16 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#17 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#18 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#19 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#20 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#21 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#22 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#23 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#24 0x00007ffff797d7db in _PyFunction_FastCallKeywords () from /usr/lib/libpython3.7m.so.1.0
#25 0x00007ffff79ef3cd in _PyEval_EvalFrameDefault () from /usr/lib/libpython3.7m.so.1.0
#26 0x00007ffff7936069 in _PyEval_EvalCodeWithName () from /usr/lib/libpython3.7m.so.1.0
#27 0x00007ffff7936f34 in PyEval_EvalCodeEx () from /usr/lib/libpython3.7m.so.1.0
#28 0x00007ffff7936f5c in PyEval_EvalCode () from /usr/lib/libpython3.7m.so.1.0
#29 0x00007ffff7a65770 in ?? () from /usr/lib/libpython3.7m.so.1.0
#30 0x00007ffff7a6754a in PyRun_FileExFlags () from /usr/lib/libpython3.7m.so.1.0
#31 0x00007ffff7a68ac5 in PyRun_SimpleFileExFlags () from /usr/lib/libpython3.7m.so.1.0
#32 0x00007ffff7a6aa8f in ?? () from /usr/lib/libpython3.7m.so.1.0
#33 0x00007ffff7a6b420 in _Py_UnixMain () from /usr/lib/libpython3.7m.so.1.0
#34 0x00007ffff7dc6223 in __libc_start_main () from /usr/lib/libc.so.6
#35 0x000055555555477a in _start ()

(gdb) 
#8  0x00007ffff6a15a15 in glad_debug_impl_glDrawArraysInstanced (arg0=6, arg1=0, arg2=4, arg3=2) at /home/tito/code/kitty/kitty/gl-wrapper.c:2532
2532         glad_glDrawArraysInstanced(arg0, arg1, arg2, arg3);

@kovidgoyal
Copy link
Owner

Hmm, OK let me think about it a little. It seems to be related to the border drawing. To confirm that you can insert an early return into the draw_borders() function in shaders.c and see if the crash goes away.

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

No branches or pull requests

2 participants