On Sat, Aug 16, 2025 at 10:43 AM penguin p <tgc...@gmail.com> wrote: > > Hi, > > As title, when I press Ctrl + R to search through history, then press Ctrl + > C to cancel I get set fault immediately. > > This issue seems to only happen in my pc. Others cannot reproduce, and the > homebrew team? recommended me to report in here. > > This bug vanished when a debugger is attached. Not sure what to do now > (except a factory reset which I prefer not to). > > Reference Github link: > https://github.com/Homebrew/homebrew-core/issues/231067
Further comments in the Github issue clarified that the crash happens when ^C is immediately followed by another character (in this case it happened to be ESC, but any other character will have the same effect). The problem is that _rl_isearch_cleanup is called by the signal handler and frees _rl_iscxt but it is then written to by _rl_search_getchar. Attached patch should address the issue and a few other cases where the same thing might occur.
0001-do-not-modify-_rl_iscxt-after-signal-cleanup.patch
Description: Binary data