[Catalyst-dev] Fix for system() returning -1 on dev server

Jon Schutz jon+catalyst at youramigo.com
Sat Oct 27 07:22:52 GMT 2007


On Fri, 2007-10-26 at 18:35 +0100, Matt S Trout wrote:

> Go find the changeset where we switched it to his, and the previous mail
> threads, and explain why this won't re-introduce the problems that caused
> us to move to IGNORE in the first place.
> 

It has been IGNORE since SIG{CHLD} was introduced.  Defining a child
reaper that just does waitpid is functionally equivalent to using
IGNORE, but apparently IGNORE has an undesirable side-effect on system
().

> Also, your patch has no tests.

optional_http-server.t + live_fork.t already tests for this and was
failing the tests for system() and backticks return codes.  Post-patch
it passes system() and still fails backticks exit code.  

Since $? may be incorrect as long as $SIG{CHLD} is defined, a code
change more significant than my two-liner would be needed to fix the
backticks result.  Backticks still work, it's just the exit code which
is wrong. One could try reaping opportunistically on each request, at
the cost of having zombies hang around for a while on a low-load server,
or double-forking with the first forked child reaped in-line, SIG{CHILD}
being defined in the subprocess to clean up the second fork, and no SIG
{CHLD} in the sub-sub-process. That is a patch for another day.

-- 

Jon



More information about the Catalyst-dev mailing list