You are here: Foswiki>Tasks Web>Item10198 (31 May 2014, GeorgeClark)Edit Attach

Item10198: sysCommand calling exit breaks in mod_perl

pencil
Priority: Urgent
Current State: No Action Required
Released In: n/a
Target Release: minor
Applies To: Engine
Component: FoswikiSandbox, ModPerlEngineContrib
Branches:
Reported By: MartinVonGagern
Waiting For:
Last Change By: GeorgeClark
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

 

ItemTemplate edit

Summary sysCommand calling exit breaks in mod_perl
ReportedBy MartinVonGagern
Codebase 1.1.1
SVN Range
AppliesTo Engine
Component FoswikiSandbox, ModPerlEngineContrib
Priority Urgent
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease minor
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
Release01x01Checkins
Topic revision: r5 - 31 May 2014, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy