[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4F79BC66.3010902@shealevy.com>
Date: Mon, 02 Apr 2012 10:49:10 -0400
From: Shea Levy <shea@...alevy.com>
To: Lluís Batlle i Rossell <viric@...ic.name>
CC: linux-kernel@...r.kernel.org
Subject: Re: Hang opening a pipe written to by a child, with SIGCHLD
On 04/02/2012 10:46 AM, Lluís Batlle i Rossell wrote:
> Hello,
>
> I had troubles running a simple bash script where a child wrote to a named pipe
> before dying, and the parent opened and read the pipe.
>
> On a computer, my script hangs always. Also under 'strace'. Not under 'strace
> -f'. Thinking of some race, I wrote a small script that hangs in the linuxes I
> could try (3.2.11 now):
>
> ----------
> #!/var/run/current-system/sw/bin/bash
>
> PIPE=/tmp/pipe
>
> rm -f $PIPE
> mkfifo $PIPE
>
> function spawn {
> echo DONE> $PIPE
> }
>
> spawn sleep 1&
>
> while true; do
> echo reading
> while read LINE< $PIPE; do
> echo $LINE
> spawn&
> done
> done
> -------------
>
> bash uses SA_RESTART on SIGCHLD handler, and nevertheless the script halts at
> printing some amount of 'DONE'. Strace shows it's inside the open() call, while the open
> call has been interrupted by SIGCHLD. One of the computers I have hangs at the *first* DONE always, and that's why it's annoying to me.
>
> Can anyone reproduce this?
I've reproduced this on my system as well (3.3). No idea about cause though.
~Shea
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists