Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-09-04 Thread Chet Ramey
On 8/25/25 5:02 PM, Grisha Levit wrote: Thanks very much for the explanation. I guess other places where RL_CHECK_SIGNALS() may be invoked while in one of those identified states should perform the same check and abort as well? Well, definitely a few. Thanks for the report. If you find other

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-25 Thread Grisha Levit
On Fri, Aug 22, 2025 at 2:58 PM Chet Ramey wrote: > > The idea is that the application's signal handler gets to decide what to > do. In most cases, it will longjmp back to some processing loop or exit. > The signal event handler provides responsiveness in the case where the > application simply se

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-23 Thread Chet Ramey
On 8/20/25 5:16 PM, Dag-Erling Smørgrav wrote: Collin Funk writes: Chet Ramey writes: This means your bison is too old. configure should have told you. This is a common MacOS issue. Since Apple is allergic to GPLv3+. Try using byacc instead. Please don't. byacc can't handle recursive par

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-22 Thread Chet Ramey
On 8/22/25 2:14 PM, penguin p wrote: /Resending I forgot to cc bug bash Chet if a SIGINT has been received, cleanup code will be executed that leaves whatever readline was doing in a state that it cannot continue from. I’m not familiar with C. So in essence, what bash was doing is like this:

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-22 Thread Chet Ramey
On 8/22/25 12:38 PM, Grisha Levit wrote: On Wed, Aug 20, 2025 at 5:31 PM Chet Ramey wrote: On 8/20/25 3:36 PM, Chet Ramey wrote: = ==1078506==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c315f7e217c at pc 0x55bc1d0

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-22 Thread penguin p
/Resending I forgot to cc bug bash > Chet > if a SIGINT has been received, cleanup code will be executed that leaves > whatever readline was doing in a state that it cannot continue from. I’m not familiar with C. So in essence, what bash was doing is like this: 1. Ctrl + R 2. readline() doing som

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-22 Thread Grisha Levit
On Wed, Aug 20, 2025 at 5:31 PM Chet Ramey wrote: > > On 8/20/25 3:36 PM, Chet Ramey wrote: > > >> = > >> ==1078506==ERROR: AddressSanitizer: heap-use-after-free on address > >> 0x7c315f7e217c at pc 0x55bc1d03b545 bp 0x7ffdbdb3c920 sp

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-21 Thread Martin D Kealey
On Thu, 21 Aug 2025 at 07:30, Chet Ramey wrote: > On 8/20/25 3:36 PM, Chet Ramey wrote: > The real issue is that readline […] does not > believe that read(2) can both succeed (return value > 0) *and* get a > signal before it returns to user mode without setting errno. […] > You either need to inj

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread Martin D Kealey
On Thu, 21 Aug 2025 at 05:48, Grisha Levit wrote: > You can reproduce this by adding a key binding to your terminal emulator > to send \003\033 for some key combination. > Or if using a terminal emulator that doesn't support programmable bindings (or indeed, just for the simplicity): stty intr

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread Chet Ramey
On 8/20/25 3:36 PM, Chet Ramey wrote: = ==1078506==ERROR: AddressSanitizer: heap-use-after-free on address 0x7c315f7e217c at pc 0x55bc1d03b545 bp 0x7ffdbdb3c920 sp 0x7ffdbdb3c910 WRITE of size 4 at 0x7c315f7e217c thread T0      #0

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread Dag-Erling Smørgrav
Collin Funk writes: > Chet Ramey writes: > > This means your bison is too old. configure should have told you. > This is a common MacOS issue. Since Apple is allergic to GPLv3+. Try using byacc instead. DES -- Dag-Erling Smørgrav - d...@des.no

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread penguin p
> Chet Ramey > What's the exact key sequence you're inputting, and are you still sending > ESC after ^C from your keyboard config? (And why do you do that?) > I assume you're typing ^R^C and your keyboard is sending ^R^C^[, right? Not exactly, when I tested Ctrl + R then Ctrl + C I was also pressi

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread Grisha Levit
On Wed, Aug 20, 2025 at 3:48 PM Grisha Levit 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 a

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread Grisha Levit
On Wed, Aug 20, 2025 at 3:37 PM Chet Ramey wrote: > > On 8/20/25 1:45 PM, penguin p wrote: > > > > > https://cgit.git.savannah.gnu.org/cgit/bash.git/?h=devel > cgit.git.savannah.gnu.org/cgit/bash.git/?h=devel> > > > > Sorry, I am not able to build using the Mac, so I go into arch linux then > >

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread Collin Funk
Chet Ramey writes: >> ./parse.y:501.23-27: symbol YYEOF is used, but is not defined as a >> token and has no rules > > This means your bison is too old. configure should have told you. This is a common MacOS issue. Since Apple is allergic to GPLv3+. See: $ /usr/bin/bison --version bison

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread Chet Ramey
On 8/20/25 1:45 PM, penguin p wrote: > https://cgit.git.savannah.gnu.org/cgit/bash.git/?h=devel cgit.git.savannah.gnu.org/cgit/bash.git/?h=devel> Sorry, I am not able to build using the Mac, so I go into arch linux then build and tested over there. I pressed so hard I got this error ``` Th

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-20 Thread Chet Ramey
On 8/19/25 10:12 PM, penguin p wrote: > Thanks for your careful analysis and fix. I applied a close variant, and > that will be in the next devel branch push. Please let me know when the new patch is ready. I can test it for you. https://cgit.git.savannah.gnu.org/cgit/bash.git/?h=devel -- `

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-19 Thread penguin p
> Thanks for your careful analysis and fix. I applied a close variant, and > that will be in the next devel branch push. Please let me know when the new patch is ready. I can test it for you.

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-19 Thread Chet Ramey
On 8/17/25 5:47 PM, Grisha Levit wrote: So while _rl_isearch_fini is being executed due to normal search termination, it gets called again from a signal handler. Thanks for your careful analysis and fix. I applied a close variant, and that will be in the next devel branch push. Chet -- ``The

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-17 Thread Grisha Levit
On Sun, Aug 17, 2025, 23:24 penguin p wrote: > > Is this with both patches applied? > > No, it was not. I’ve now applied both patch and tested again. > > I pressed for several minutes and couldn't seem to trigger segfault. > > I think it is now fixed! > > Thank you for your help!! I can now rest

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-17 Thread Grisha Levit
On Sun, Aug 17, 2025, 23:08 penguin p wrote: > I’ve applied your patch and tried again. Now it does this > > ``` > This is workbench@ArchLinux: ~/works/bash > $ ^C > This is workbench@ArchLinux: ~/works/bash > $ ^C > This is workbench@ArchLinux: ~/works/bash >

Re: [PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-17 Thread penguin p
> > The following change should fix this. > --- > Ref: https://lists.gnu.org/archive/html/bug-bash/2025-08/msg00080.html > > lib/readline/isearch.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/lib/readline/isearch.c b/lib/readline/isearch.c > index 241e2ee0..10483

[PATCH] _rl_isearch_cleanup: avoid nested execution

2025-08-17 Thread Grisha Levit
On Sun, Aug 17, 2025 at 2:04 PM penguin p wrote: > [...] > 5 bash 0x100ca36e8 update_line + 9096 (display.c:2133) > 6 bash 0x100c9b2dc rl_redisplay + 27264 (display.c:1368) > 7 bash 0x100ca8924 rl_clear_message + 128 (display.c:3194) > 8 bash 0x100c93ab0 _rl_isearch_fini + 2396 (isea