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

kitty crashes randomly when working with split views #4739

Closed
ad-on-is opened this issue Feb 23, 2022 · 4 comments
Closed

kitty crashes randomly when working with split views #4739

ad-on-is opened this issue Feb 23, 2022 · 4 comments
Labels

Comments

@ad-on-is
Copy link

For some reason kitty crashes when opening closing windows in split view. Unfortunately I cannot find the pattern when this happens. It can be when multiple views are open, sometimes when there are just two.

While the pattern goes as follows, it is not limited to the exact order or amount of steps

  1. open new split view
  2. open another
  3. close one of them
  4. open another again
  5. ...
  6. ...
  • !crash!
@ad-on-is ad-on-is added the bug label Feb 23, 2022
@kovidgoyal
Copy link
Owner

I am going to need either a way to reproduce or at least a crash report generated by building kitty with

make asan

https://sw.kovidgoyal.net/kitty/build/

Once you have either of those update the bug report and I will re-open

@ad-on-is
Copy link
Author

Sorry, didn't know about the make asan command. I just did some splits/closes until it crashed, and here's the output.

Output

Crash-Report

./kitty/launcher/kitty
[054 18:04:03.439017] Ignoring invalid config line: symbol_map
[054 18:04:03.439108] Ignoring invalid config line: font_features
[054 18:04:03.439799] Ignoring invalid config line: url_excluded_characters
[054 18:04:03.442088] Ignoring invalid config line: env
[054 18:04:03.442171] Ignoring invalid config line: watcher
[054 18:04:03.442197] Ignoring invalid config line: exe_search_path
[054 18:04:03.442313] Ignoring invalid config line: file_transfer_confirmation_bypass
[054 18:04:03.442710] Ignoring invalid config line: action_alias
[054 18:04:03.442747] Ignoring invalid config line: kitten_alias

=================================================================
==209692==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 97944 byte(s) in 87 object(s) allocated from:
#0 0x7ff61b355dd9 in __interceptor_malloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7ff61aee9dcd in PyObject_Malloc (/usr/lib/libpython3.10.so.1.0+0x120dcd)

Direct leak of 4323 byte(s) in 7 object(s) allocated from:
#0 0x7ff61b355dd9 in __interceptor_malloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7ff61aeeb397 (/usr/lib/libpython3.10.so.1.0+0x122397)

Direct leak of 472 byte(s) in 2 object(s) allocated from:
#0 0x7ff61b355dd9 in __interceptor_malloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7ff61afb5e0d (/usr/lib/libpython3.10.so.1.0+0x1ece0d)
#2 0x7665442f73696e6e ()

Direct leak of 224 byte(s) in 1 object(s) allocated from:
#0 0x7ff61b355dd9 in __interceptor_malloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7ff61afb5e0d (/usr/lib/libpython3.10.so.1.0+0x1ece0d)
#2 0x74616470752e7973 ()

Direct leak of 28 byte(s) in 1 object(s) allocated from:
#0 0x7ff61b355dd9 in __interceptor_malloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7ff61afb5e0d (/usr/lib/libpython3.10.so.1.0+0x1ece0d)

Indirect leak of 6960 byte(s) in 6 object(s) allocated from:
#0 0x7ff61b355dd9 in __interceptor_malloc /usr/src/debug/gcc/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x7ff61aeeb397 (/usr/lib/libpython3.10.so.1.0+0x122397)

SUMMARY: AddressSanitizer: 109951 byte(s) leaked in 104 allocation(s).
AddressSanitizer:DEADLYSIGNAL

==209668==ERROR: AddressSanitizer: SEGV on unknown address 0x6340e211f912 (pc 0x7f3f85db5c74 bp 0x7fffb6dbca50 sp 0x7fffb6dbca30 T0)
==209668==The signal is caused by a READ memory access.
#0 0x7f3f85db5c74 in linebuf_char_width_at kitty/line-buf.c:156
#1 0x7f3f85e3b793 in screen_fake_move_cursor_to_position kitty/screen.c:1544
#2 0x7f3f85de2d2b in move_cursor_to_mouse_if_at_shell_prompt kitty/mouse.c:457
#3 0x7f3f85e7bb4a in move_cursor_to_mouse_if_in_prompt kitty/state.c:1164
#4 0x7f3f85e7bcf4 in pymove_cursor_to_mouse_if_in_prompt kitty/state.c:1209
#5 0x7f3f8b0442f7 (/usr/lib/libpython3.10.so.1.0+0x1502f7)
#6 0x7f3f8b03e7ca in _PyObject_MakeTpCall (/usr/lib/libpython3.10.so.1.0+0x14a7ca)
#7 0x7f3f8b0397bb in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x1457bb)
#8 0x7f3f8b033391 (/usr/lib/libpython3.10.so.1.0+0x13f391)
#9 0x7f3f8b0500f4 (/usr/lib/libpython3.10.so.1.0+0x15c0f4)
#10 0x7f3f8b037224 in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x143224)
#11 0x7f3f8b04473b in _PyFunction_Vectorcall (/usr/lib/libpython3.10.so.1.0+0x15073b)
#12 0x7f3f8b034a9a in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x140a9a)
#13 0x7f3f8b04ffc3 (/usr/lib/libpython3.10.so.1.0+0x15bfc3)
#14 0x7f3f8b0357d8 in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x1417d8)
#15 0x7f3f8b033391 (/usr/lib/libpython3.10.so.1.0+0x13f391)
#16 0x7f3f8b0500f4 (/usr/lib/libpython3.10.so.1.0+0x15c0f4)
#17 0x7f3f8b0e9fc8 (/usr/lib/libpython3.10.so.1.0+0x1f5fc8)
#18 0x7f3f8b13b388 in _PyObject_CallMethod_SizeT (/usr/lib/libpython3.10.so.1.0+0x247388)
#19 0x7f3f85ddf535 in dispatch_mouse_event kitty/mouse.c:144
#20 0x7f3f85de3453 in send_pending_click_to_window kitty/mouse.c:491
#21 0x7f3f85e937ed in send_pending_click_to_window_id kitty/state.c:596
#22 0x7f3f84c18327 in dispatchTimers glfw/backend_utils.c:209
#23 0x7f3f84c18b63 in pollForEvents glfw/backend_utils.c:310
#24 0x7f3f84bee95f in handleEvents glfw/x11_window.c:71
#25 0x7f3f84beea35 in _glfwPlatformWaitEvents glfw/x11_window.c:2727
#26 0x7f3f84bcd015 in _glfwPlatformRunMainLoop glfw/main_loop.h:30
#27 0x7f3f84babe18 in glfwRunMainLoop glfw/init.c:353
#28 0x7f3f85d4ffd1 in run_main_loop kitty/glfw.c:1560
#29 0x7f3f85ca389c in main_loop kitty/child-monitor.c:1114
#30 0x7f3f8b047056 (/usr/lib/libpython3.10.so.1.0+0x153056)
#31 0x7f3f8b034a9a in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x140a9a)
#32 0x7f3f8b04473b in _PyFunction_Vectorcall (/usr/lib/libpython3.10.so.1.0+0x15073b)
#33 0x7f3f8b034768 in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x140768)
#34 0x7f3f8b03da67 in _PyObject_FastCallDictTstate (/usr/lib/libpython3.10.so.1.0+0x149a67)
#35 0x7f3f8b04d60c in _PyObject_Call_Prepend (/usr/lib/libpython3.10.so.1.0+0x15960c)
#36 0x7f3f8b1256a1 (/usr/lib/libpython3.10.so.1.0+0x2316a1)
#37 0x7f3f8b03e7ca in _PyObject_MakeTpCall (/usr/lib/libpython3.10.so.1.0+0x14a7ca)
#38 0x7f3f8b0397bb in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x1457bb)
#39 0x7f3f8b04473b in _PyFunction_Vectorcall (/usr/lib/libpython3.10.so.1.0+0x15073b)
#40 0x7f3f8b034768 in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x140768)
#41 0x7f3f8b04473b in _PyFunction_Vectorcall (/usr/lib/libpython3.10.so.1.0+0x15073b)
#42 0x7f3f8b034768 in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x140768)
#43 0x7f3f8b04473b in _PyFunction_Vectorcall (/usr/lib/libpython3.10.so.1.0+0x15073b)
#44 0x7f3f8b034768 in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x140768)
#45 0x7f3f8b033391 (/usr/lib/libpython3.10.so.1.0+0x13f391)
#46 0x7f3f8b0ebc13 in PyEval_EvalCode (/usr/lib/libpython3.10.so.1.0+0x1f7c13)
#47 0x7f3f8b0f3670 (/usr/lib/libpython3.10.so.1.0+0x1ff670)
#48 0x7f3f8b04493f (/usr/lib/libpython3.10.so.1.0+0x15093f)
#49 0x7f3f8b034768 in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x140768)
#50 0x7f3f8b04473b in _PyFunction_Vectorcall (/usr/lib/libpython3.10.so.1.0+0x15073b)
#51 0x7f3f8b034768 in _PyEval_EvalFrameDefault (/usr/lib/libpython3.10.so.1.0+0x140768)
#52 0x7f3f8b04473b in _PyFunction_Vectorcall (/usr/lib/libpython3.10.so.1.0+0x15073b)
#53 0x7f3f8b110d67 (/usr/lib/libpython3.10.so.1.0+0x21cd67)
#54 0x7f3f8af8780e (/usr/lib/libpython3.10.so.1.0+0x9380e)
#55 0x7f3f8af4da54 in Py_Main (/usr/lib/libpython3.10.so.1.0+0x59a54)
#56 0x5633e78922dd in run_embedded /home/adonis/Development/Python/kitty/launcher.c:192
#57 0x5633e7892a70 in main /home/adonis/Development/Python/kitty/launcher.c:283
#58 0x7f3f8a3a230f in __libc_start_call_main (/usr/lib/libc.so.6+0x2d30f)
#59 0x7f3f8a3a23c0 in __libc_start_main@GLIBC_2.2.5 (/usr/lib/libc.so.6+0x2d3c0)
#60 0x5633e7891274 in _start (/home/adonis/Development/Python/kitty/kitty/launcher/kitty+0x3274)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV kitty/line-buf.c:156 in linebuf_char_width_at
==209668==ABORTING

@kovidgoyal
Copy link
Owner

Please test the fix as I cannot reproduce the crash.

@ad-on-is
Copy link
Author

Thank you...
After applying the patch, I couldn't reproduce the issue either. Since it happens randomly, but at least once in a few hours, I'll keep an eye on it until evening and report back.

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

2 participants