Subject: | Try::Tiny + fatal warnings + qx + Can't exec = fork |
Date: | Tue, 29 Mar 2016 16:00:32 +0100 |
To: | bug-Try-Tiny [...] rt.cpan.org |
From: | Matthew Astley <mca [...] sanger.ac.uk> |
I found `try` can interfere with Perl's `system` and `qx` builtins,
resulting in an accidental fork of the process. The test case is at
https://gist.github.com/mcast/f527e7aa36d2ab9788ce#file-plain-system-t
I suspect the warning of "Can't exec" is promoted to an error, which
is then rescued by try, and this skips some tidying up.
Capture::Tiny is no longer implicated, as I first thought. I don't
know if it is possible to reduce the case further.
It looks like a workaround would be to call POSIX::_exit($? || 1) if
$$ changed. This should be enough for a single-threaded process...
Hopefully I reported this in the right place. If not, perhaps you can
suggest somewhere else I can take the gist? Thanks,
--
Matthew
--
The Wellcome Trust Sanger Institute is operated by Genome Research
Limited, a charity registered in England with number 1021457 and a
company registered in England with number 2742969, whose registered
office is 215 Euston Road, London, NW1 2BE.