Issue 11170

Summary: SEGV caused by race condition in osl_executeProcess()
Product: porting Reporter: matthias.huetsch
Component: codeAssignee: matthias.huetsch
Status: CLOSED FIXED QA Contact: issues@porting <issues>
Severity: Trivial    
Priority: P3 CC: issues
Version: 644   
Target Milestone: OOo 1.1 Beta   
Hardware: PC   
OS: Linux, all   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description matthias.huetsch 2003-02-03 19:45:26 UTC
The implementation of 'osl_executeProcess()' internally uses a thread which in
turn starts (and wait()'s on) the requested process.

The thread start routine 'ChildStatusProc()' and 'osl_executeProcess()'
communicate via a shared data structure containing some file handles and a
condition variable that is signaled when the child process has been started.

The race condition occurs should execution of the child process fail. In this
case the shared data structure is accessed after the condition is signaled,
such that the parent thread may have destroyed that shared data, already, which
more often that not results in a SEGV.

In the case of child process execution success, the code has the correct order
of instructions and there's no race condition.
Comment 1 matthias.huetsch 2003-02-03 19:47:02 UTC
Accepting, with Target Milestone OOo 1.1 Beta.
Comment 2 matthias.huetsch 2003-02-03 20:14:38 UTC
Fixed in porting/sal/osl/unx/process.c r1.26.2.1.4.1 on SRX644/mhu01.
Comment 3 matthias.huetsch 2003-02-03 20:15:50 UTC
...where 'SRX644/mhu01' means tag 'cws_srx644_mhu01'...
Comment 4 matthias.huetsch 2003-02-17 21:55:22 UTC
Fix integrated into OOo 1.1 master workspace (cvs tag SRX644_m4) as
porting/sal/osl/unx/process.c, r1.26.2.2, thus closing this issue.