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

Jon Schutz jon+catalyst at youramigo.com
Fri Oct 26 04:33:51 GMT 2007


That system() returns -1 while running on the Catalyst::Engine::HTTP
server seems to be a well known fact and was discussed on the list a
year ago (didn't stop the bug biting me again but).

I have traced the cause to HTTP.pm, line 191 or thereabouts:

    local $SIG{CHLD} = 'IGNORE';

Getting rid of this line, or setting $SIG{CHLD} to a proper child reaper
handler, fixes the problem with system().  

There's a warning in perlvar that $? may be incorrect if SIG{CHLD} is
defined; presumably it's either that or that defining the IGNORE handler
interferes with the internals of the system() call for retrieving the
exit status. 

Patch against svn that sets an appropriate reaper is attached.

-- 

Jon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: catalyst-http-patch.txt
Type: text/x-patch
Size: 802 bytes
Desc: not available
Url : http://lists.scsys.co.uk/pipermail/catalyst-dev/attachments/20071026/0ffb4f29/catalyst-http-patch.bin


More information about the Catalyst-dev mailing list