develooper Front page | perl.perl5.porters | Postings from June 2008

[PATCH] [perl #49073] SIGTERM not terminating child process

Thread Previous
Jerry D. Hedden
June 13, 2008 12:05
[PATCH] [perl #49073] SIGTERM not terminating child process
Message ID:
Jerry D. Hedden reported:
> This shows that the SIGTERM to the child process is knocking
> it out of its sleep call, but is not terminating the process.

Jarkko Hietaniemi replied:
> I'm not saying that this shouldn't be made to work in Time::HiRes,
> what I am saying is that four different UNIXes (running mostly
> 5.8.8, one running 5.8.4) do not exhibit this behaviour, so I'm
> thinking something might be funny in Cygwin.

Reini Urban wrote:
> I can confirm this failing SIGTERM cygwin behaviour
> but didn't dig into a fix yet.

Attached is a workaround for t/HiRes.t to at least keep the
Time::HiRes test from reporting failures until the underlying
SIGTERM/sleep bug is fixed.

The workaround is to split the child's sleep in two.  When the
parent sends SIGTERM, either the child will just die (basic case)
or will fall into a second short sleep (this is the workaround).
In the later case, the parent will then terminate, the child
will wake up, see that the parent has exited and will gracefully
exit as well.

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About