Re:Kakoune Code Editor
by HKH2 on Tuesday January 18, 2022 @06:56AM
(#29977838)
How did you get Kakoune to segfault?
[ Parent
| on HN ]
Re:Kakoune Code Editor
by sidkshatriya on Tuesday January 18, 2022 @07:08AM
(#29977929)
Kakoune is built in C++. So bugs will sometimes manifest as segfaults. You could be doing some normal editing, press a sequence of editing commands that might trigger some code that may subtly wrong. Sometime later, when C++ code tries to write to memory that it shouldn't have, you will segfault.
In that respect this is true for any C/C++ application. Kakoune keeps fixing these issues as they come up.
Re:Kakoune Code Editor
by sidkshatriya on Tuesday January 18, 2022 @05:38PM
(#29987110)
> tries to write to memory that it shouldn’t have
To elaborate what I mean here is maybe the program tried to write to an address not mapped to its address space etc. This happens due to bugs in the program e.g. not calculating the offset into an array properly and so forth. There are many ways to mess up when using C/C++!
You can segfault in rust, too:
fn totally_safe() -> i32 {
unsafe { *std::ptr::null() }
}
This commonly happens if the person who wrote 'totally safe' thinks what they're doing is fine, and it actually isn't.