bug-readline
[Top][All Lists]
Advanced

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

Re: pending signal after rl_callback_read_char


From: Chet Ramey
Subject: Re: pending signal after rl_callback_read_char
Date: Wed, 12 Oct 2022 10:03:10 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.3.1

On 10/11/22 3:35 PM, Simon Marchi wrote:

Readline could probably get most or all of the way there by modifying
CALLBACK_READ_RETURN to call rl_check_signals/RL_CHECK_SIGNALS after
calling rl_clear_signals and before the return. What do you think?

I'm getting back to looking at this. I've attached a patch that does this.
Try it out and let me know.

Hi Chet,

As far as I understand, this is equivalent to the fix we've done in GDB
here:

More or less, but internal to readline.


While reviewing this code, a question popped: given that readline only
records a single signal number in _rl_caught_signal, what happens if two
different signals (say, SIGINT and SIGWINCH) arrive in between two
RL_CHECK_SIGNALS?  Won't it cause the second signal number to overwrite
the first one, and the first one to be missed?

In theory, yes. That would mean the granularity of handling signals inside
readline isn't fine enough. I haven't received any reports about this to
this point, though.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/




reply via email to

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