httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <...@covalent.net>
Subject Re: cvs commit: httpd-2.0 CHANGES
Date Tue, 12 Jun 2001 20:55:13 GMT

-1.  We have discussed this on list multiple times.  The solution is to
use the setaside pool argument that Greg Stein just added.  This patch is
as bad as the original hack (using c->pool for files), because it creates
a huge resource leak.  Imagine a simple SSI file with twenty small
included files, you just leaked 20 files until the end of the request.
This gets worse if the number of included files is larger, and other
modules may make the problem even worse.

Ryan

On 12 Jun 2001 gregames@apache.org wrote:

> gregames    01/06/12 12:03:09
>
>   Modified:    server   core.c
>                .        CHANGES
>   Log:
>   Fix seg faults and/or missing output from mod_include.  The
>   default_handler was using the subrequest pool for files and
>   MMAPs, even though the associated APR structures typically
>   live longer than the subrequest.
>
>   Revision  Changes    Path
>   1.18      +3 -1      httpd-2.0/server/core.c
>
>   Index: core.c
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/server/core.c,v
>   retrieving revision 1.17
>   retrieving revision 1.18
>   diff -u -d -b -u -r1.17 -r1.18
>   --- core.c	2001/06/08 16:39:48	1.17
>   +++ core.c	2001/06/12 19:03:04	1.18
>   @@ -2920,6 +2920,7 @@
>         *     when the charset is translated).
>         */
>        int bld_content_md5;
>   +    apr_pool_t *main_pool;
>
>        /*
>         * The old way of doing handlers meant that this handler would
>   @@ -2964,8 +2965,9 @@
>        if (r->method_number != M_GET && r->method_number != M_POST) {
>            return HTTP_METHOD_NOT_ALLOWED;
>        }
>   +    main_pool = (r->main) ? (r->main->pool) : (r->pool);
>
>   -    if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0,
r->pool)) != APR_SUCCESS) {
>   +    if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0,
main_pool)) != APR_SUCCESS) {
>            ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
>    		     "file permissions deny server access: %s", r->filename);
>            return HTTP_FORBIDDEN;
>
>
>
>   1.225     +5 -0      httpd-2.0/CHANGES
>
>   Index: CHANGES
>   ===================================================================
>   RCS file: /home/cvs/httpd-2.0/CHANGES,v
>   retrieving revision 1.224
>   retrieving revision 1.225
>   diff -u -d -b -u -r1.224 -r1.225
>   --- CHANGES	2001/06/12 17:05:55	1.224
>   +++ CHANGES	2001/06/12 19:03:08	1.225
>   @@ -1,4 +1,9 @@
>    Changes with Apache 2.0.19-dev
>   +  *) Fix seg faults and/or missing output from mod_include.  The
>   +     default_handler was using the subrequest pool for files and
>   +     MMAPs, even though the associated APR structures typically
>   +     live longer than the subrequest. [Greg Ames]
>   +
>      *) Extend mod_setenvif to support specifying regular expressions
>         on the SetEnvIf (and SetEnvIfNoCase) directive attribute field.
>         Example:  SetEnvIf ^TS*  [a-z].* HAVE_TS
>
>
>
>
>


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------



Mime
View raw message