AnyEvent::Util::run_cmd bug
Andrew Suffield
asuffield at acunu.com
Thu Aug 11 22:32:37 CEST 2011
Linux (lucid), A::I was being used, should have been the built-in perl event
loop (since I didn't do anything special or install EV). I diagnosed it as
EINTR failing a read with strace; I can look more closely at how things got
to that point tomorrow if there's something odd going on here.
30204 read(5, <unfinished ...>
30204 <... read resumed> 0x95889e0, 16384) = ? ERESTARTSYS (To be restarted)
30204 --- SIGCHLD (Child exited) @ 0 (0) ---
30204 write(3, "\1\0\0\0\0\0\0\0", 8) = 8
30204 rt_sigreturn(0x3) = -1 EINTR (Interrupted system call)
30204 rt_sigprocmask(SIG_BLOCK, [KILL], NULL, 8) = 0
30204 rt_sigprocmask(SIG_UNBLOCK, [KILL], NULL, 8) = 0
30204 close(5) = 0
It's a little funky because the kernel thought it might be restartable but
for some reason that didn't work out; rt_sigreturn is the exit from the
signal handler, and its return value is that of the read syscall. 5 is the
read-end of the pipe-to-scalar-ref I attached to stdout.
(Then the child process dies to a SIGPIPE because it can't write to stdout
any more, and I spend a couple hours digging to figure out why my child
processes are infrequently returning nothing on stdout and not failing)
On 11 August 2011 19:19, Marc Lehmann <schmorp at schmorp.de> wrote:
> On Thu, Aug 11, 2011 at 06:07:55PM +0100, Andrew Suffield <
> asuffield at acunu.com> wrote:
> > This is wrong when sysread returns undef with $! == EINTR - it will close
> > the fd. In my case it was SIGCHLD from another instance of run_cmd
> arriving
> > at an inopportune moment.
>
> It shouldn't normally happen with restartable signals - which OS and event
> loop did you use (and was Async::Interrupt installed?).
>
> --
> The choice of a Deliantra, the free code+content MORPG
> -----==- _GNU_ http://www.deliantra.net
> ----==-- _ generation
> ---==---(_)__ __ ____ __ Marc Lehmann
> --==---/ / _ \/ // /\ \/ / schmorp at schmorp.de
> -=====/_/_//_/\_,_/ /_/\_\
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/anyevent/attachments/20110811/545e3fae/attachment.htm>
More information about the anyevent
mailing list