You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2004/08/28 11:44:51 UTC

DO NOT REPLY [Bug 30913] New: - apr_proc_create() has unexpected side effect

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30913>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30913

apr_proc_create() has unexpected side effect

           Summary: apr_proc_create() has unexpected side effect
           Product: APR
           Version: 0.9.4
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: APR
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: y@haya.se


apr_proc_create() on unix OS calls apr_pool_cleanup_for_exec() and
exit() in forked child process.  These functions call registered
functions.  This causes unexpected behaviour if registered functions
have side effect to the outside of process.

For example, I use svn_io_open_unique_file() in library of subversion.
This function can create temporary file which will be deleted when the
pool is cleaned up.  I wrote program that create temporary file and
pass the temporary file to external command using apr_proc_create().
This program doesn't performs what I intended to because pool cleanup
in child process deletes temporary file before executing external
command.

Similarly, exit() executes functions registered by atexit().

Thus apr_proc_create() should use _exit() instead of exit().  Although
I am not detailed about apr_pool_cleanup_for_exec(), it seems
overkill.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org