apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@ebuilt.com>
Subject mod_cgid broken in HEAD...
Date Fri, 26 Oct 2001 21:13:49 GMT
I'm getting "Premature End of Script Headers" in mod_cgid with 
revision 1.51 of apr/threadproc/unix/proc.c.  Reverting it to 
1.50 seems to make it okay over here.

I'm seeing APR_EOF when trying to read from the socket in the
httpd (non-cgid) process.  Jeff?  -- justin

<Log for 1.51>
apr_proc_create():
do exec cleanup before duping pipes to fds 0-2; otherwise,
any files cleaned up with those fds will hose our pipes;
typical symptom is APR_EOF in the parent when trying to read
child output
</Log>

<Diff>
===================================================================
RCS file: /home/cvspublic/apr/threadproc/unix/proc.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -r1.50 -r1.51
--- apr/threadproc/unix/proc.c	2001/10/23 17:30:08	1.50
+++ apr/threadproc/unix/proc.c	2001/10/26 18:13:02	1.51
@@ -289,6 +289,12 @@
     else if (new->pid == 0) { 
         int status;
         /* child process */
+
+        /* do exec cleanup before duping pipes to fds 0-2; otherwise,
+         * any files cleaned up with those fds will hose our pipes
+         */
+        apr_pool_cleanup_for_exec();
+
         if (attr->child_in) {
             apr_file_close(attr->parent_in);
             dup2(attr->child_in->filedes, STDIN_FILENO);
@@ -312,8 +318,6 @@
                 exit(-1);   /* We have big problems, the child should exit. */
             }
         }
-
-        apr_pool_cleanup_for_exec();
 
         if ((status = limit_proc(attr)) != APR_SUCCESS) {
             return status;
</Diff>


Mime
View raw message