Item10198: sysCommand calling exit breaks in mod_perl
Priority: Urgent
Current State: No Action Required
Released In: n/a
Target Release: minor
Foswiki::Sandbox::sysCommand calls
exit
for the child process of a fork. In a
mod_perl environment, this
exit
is
ModPerl::Util::exit which does throw resp
die
with an
APR::Error to be caught by
Foswiki::UI::_execute leading to an
Unspecified error
message. One suitable alternative might be to use
CORE::exit
instead. I'm not sure if there are better alternatives.
--
MartinVonGagern - 27 Dec 2010
Found this when triaging. Should be fairly easy to reproduce. It would explain the occasional error of this type I have seen.
Raising from Normal to Urgent, target 1.2.0
--
CrawfordCurrie - 12 Oct 2011
Child processes are clones of the parent mod_perl process, so should add to the set of available mod_perl processes. If we
CORE::exit
it, we will end up creating more helpers than necessary. We might need to catch
APR::Error
in
UI.pm
and allow it to propagate, as described in the mod_perl doc.
There are two failure modes for a subprocesses; first, that the exec failed to find the command, and the call returns false. Second if the command itself fails with a non-zero exit status. It is only in the first case that
exit
is called.
I have tried everything I can think of to get it to fail in the way described, but cannot. The exit is handled correctly, and the "Unspecified error" is never generated. Reported may have been seeing an issue with a version of mod_perl or apache, or even perl, I cannot tell.
No action required.
--
CrawfordCurrie - 22 Mar 2013