bug-readline
[Top][All Lists]
Advanced

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

pending signal after rl_callback_read_char


From: Tom de Vries
Subject: pending signal after rl_callback_read_char
Date: Fri, 16 Sep 2022 16:25:56 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

Hi,

with gdb we've run into a PR ( https://sourceware.org/bugzilla/show_bug.cgi?id=27813 ) where the call to rl_callback_read_char returns with rl_pending_signal () != 0 after pressing ^C.

This manifests as two related problems:
- a hang
- during the hang, after doing another keystroke, say a "\n",
  it has effect before the ^C.  So, say you typed a command and changed
  you mind about executing it and press ^C, followed by "\n", the
  command will still execute, after which the ^C will take effect.

We fixed this here ( https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=faf01aee1d03aef5b6f95fd0db358bf5e70578f9 ) like so:
...
       rl_callback_read_char ();
+      while (rl_pending_signal () != 0)
+       rl_check_signals ();
...
but rl_check_signals is only available for readline >= 8.0.

So, is this a readline bug?

If not, how are we supposed to fix this in readline < 8.0 (relevant for distros building gdb against system readline)?

Thanks,
- Tom



reply via email to

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