bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution


From: Grisha Levit
Subject: Re: [PATCH] _rl_isearch_cleanup: avoid nested execution
Date: Wed, 20 Aug 2025 15:57:35 -0400

On Wed, Aug 20, 2025 at 3:48 PM Grisha Levit <grishalevit@gmail.com> wrote:
> You can reproduce this by adding a key binding to your terminal emulator
> to send \003\033 for some key combination. This worked for me in both
> Terminal.app and iTerm, though it might take a few rounds of entering
> incremental search mode and hitting the custom key combination.

Or on Linux by injecting a SIGINT with strace:

strace --trace-fds 0 -e read --inject=read:signal=SIGINT:when=2 \
    -E INPUTRC=/ -E HISTFILE= -E PS1='$ ' \
    -E ASAN_OPTIONS="${ASAN_OPTIONS:+$ASAN_OPTONS:}detect_leaks=0" \
    ./bash --norc -in <<< $'\cR\e'

$ read(0, "\22", 1)                       = 1
(reverse-i-search)`': read(0, "\33", 1)                       = 1
--- SIGINT {si_signo=SIGINT, si_code=SI_KERNEL} ---
$ --- SIGINT {si_signo=SIGINT, si_code=SI_USER, si_pid=303292, si_uid=1000} ---
=================================================================
==303292==ERROR: AddressSanitizer: heap-use-after-free on address ...
WRITE of size 4 at 0xe6bad49e037c thread T0
    #0 0xbf85676577b0 in _rl_search_getchar isearch.c:322:18
...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]