-
Notifications
You must be signed in to change notification settings - Fork 716
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
[BUG][CRASH] Signal: 11 (SEGV) #5220
Comments
Cannot see what might be going on here, next time it reproduces and you have it in gdb, would you be able to see where we are in frame I think we are inside one of the on_key_with_auto_info calls that then call insert, but I cannot see how either of them (the one at input_handler.cpp:1308 and the one at input_handler.cpp:1361) would generate either and empty ArrayView or a bad string. |
Sorry I never used gdb before and already recompiled kakoune so I suppose some info might have been lost. How do I check list of strings we have passed to |
Got same crash today with
|
Screencast.from.2024-08-27.17-05-01.webmBottom pane shows my key presses. Basically what I did is
|
Unfortunately I cannot yet make sense of what is happening, the issue seems to be that whatever is in the default register My intuition is that somehow lsp-snippets-select-next-placeholders corrupts the yanked data but I cannot see how, would you be able to reproduce while running Kakoune in valgrind or with asan enabled (build with |
The screen recording looks like you pressed If I type I'm trying to reproduce; can you reduce your config, ideally trigger it with an empty |
ok I can reproduce with |
it's a use-after free of the unnamed register.
|
here's a reproducer:
|
Before performing the insertion, InsertCompleter::insert calls try_accept() to accept any selected completion candidate. If there is one, we fire InsertCompletionHide. If that one modifies the register used by <c-r>, the inserted StringViews will be dangling. Fix this by running try_insert first, and read from the register later. Note that we call try_accept() twice but that's fine. It would probably make more sense to copy the register before calling insert() but I don't think it matters. Closes mawww#5220
proposed fix here |
Version of Kakoune
Kakoune 2024.05.18-68-gf8b39723
Reproducer
It's hard to reproduce because it happens sometimes. I believe crash happened after invoking following kak-lsp mapping:
I hope that following stack trace is clear enough to understand what's going on.
Outcome
Expectations
No crash.
Additional information
Output from gdb:
The text was updated successfully, but these errors were encountered: