[Top][All Lists]

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

Re: [BUG] Bash not reacting to Ctrl-C

From: Chet Ramey
Subject: Re: [BUG] Bash not reacting to Ctrl-C
Date: Mon, 28 Feb 2011 21:20:10 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv: Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7

On 2/11/11 6:35 PM, Linus Torvalds wrote:
> On Fri, Feb 11, 2011 at 1:30 PM, Linus Torvalds
> <address@hidden> wrote:
>> The other case is that the child process was quick and already exited.
>> You get ^C, but the child never did. When you do the waitpid(), you'll
>> never get the EINTR, because there was no actual wait.
> Ok, so here's a suggested patch. It took much longer than expected,
> because I found another independent race while trying to fix this:
> bash did the "restore_sigint_handler()" _after_ having already tested
> the "wait_sigint_received" value, so what could happen is that the
> SIGINT would happen _after_ the test of that flag, but before the
> signal handler was restored, so bash would (once more) drop the ^C on
> the floor.

The patch looks good.  I'll take a closer look and probably produce a
patch for bash-4.2 based on it.  Thanks for taking a look.

``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRU    address@hidden    http://cnswww.cns.cwru.edu/~chet/

reply via email to

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