httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Terbush <ra...@zyzzyva.com>
Subject Multiple close of FILE in mod_include exec()
Date Sun, 21 Jul 1996 20:55:38 GMT

Is this not also a problem with the call to spawn_child in mod_cgi?
Howard's patch is included at the end.
Please vote.



------- Forwarded Message

Date: Sun, 14 Jul 1996 22:04:10 -0600
From: Howard Fear <hsf@pooh.pageplus.com>
Sender: owner-new-httpd@hyperreal.com
Precedence: bulk
Reply-To: new-httpd@hyperreal.com

- ------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <32112.837403407.1@pooh.pageplus.com>

The following is a valid problem and fix:

Rob Hartill writes:
> 
> BTW, if this is a valid fix, then Howard you should probably look to
> see if you inherrited the bug for mod_xinclude.c
> 
>>==========
>>>*** apache-1.1.1/src/mod_include.c      Tue Jul  9 12:43:18 1996
>>>--- apache-1.1.1a/src/mod_include.c     Sun Jul 14 20:03:25 1996
>>>***************
>>>*** 506,512 ****
>>>          return -1;
>>> 
>>>      send_fd(f,r);
>>>!     pfclose(r->pool, f);      /* will wait for zombie when
>>>                                 * r->pool is cleared
>>>                                 */
>>>      return 0;
>>>--- 506,512 ----
>>>          return -1;
>>> 
>>>      send_fd(f,r);
>>>!     pfclose(r->connection->pool, f);  /* will wait for zombie when
>>>                                 * r->pool is cleared
>>>                                 */
>>>      return 0;
>>>===========

This causes a more specific case of the linux problem I patched in 1.1b3,
attempting to close an fd twice.  On Linux, this causes a core dump which
creates additional fork/exec load.  Otherwise, I don't think that there
are any other effects :-) (Meaning systems that don't core may not see it
at all.  The process does eventually get wait'd on, so it shouldn't
result in zombies - although I could be wrong here.)

I do suspect, though, that I would change both to be r->pool instead of
r->connection->pool.  This would be more consistent with the meaning of
both and the usage in mod_include.c.  Attached is the patch.

- --
Howard Fear      email1: howard_fear@pageplus.com
                 email2: howard_fear@stortek.com
                 http://www.pageplus.com/~hsf/


- ------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <32112.837403407.2@pooh.pageplus.com>

*** mod_include.c.dist	Sun Jul 14 21:45:05 1996
- --- mod_include.c	Sun Jul 14 21:57:40 1996
***************
*** 501,507 ****
  
      arg.r = r; arg.s = s;
  
!     if (!spawn_child (r->connection->pool, include_cmd_child, &arg,
  		      kill_after_timeout, NULL, &f))
          return -1;
      
- --- 501,507 ----
  
      arg.r = r; arg.s = s;
  
!     if (!spawn_child (r->pool, include_cmd_child, &arg,
  		      kill_after_timeout, NULL, &f))
          return -1;
      

- ------- =_aaaaaaaaaa0--

------- End of Forwarded Message




Mime
View raw message