You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by re...@apache.org on 2002/04/19 21:16:24 UTC

cvs commit: httpd-2.0/modules/cache mod_file_cache.c

rederpj     02/04/19 12:16:23

  Modified:    .        CHANGES
               modules/cache mod_file_cache.c
  Log:
   Moved the call to apr_mmap_dup outside the error branch so
   that it would actually get called. This fixes a core dump
   at init everytime you use the MMapFile directive. [Paul J. Reder]
  
  Revision  Changes    Path
  1.718     +3 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.717
  retrieving revision 1.718
  diff -u -r1.717 -r1.718
  --- CHANGES	19 Apr 2002 18:31:19 -0000	1.717
  +++ CHANGES	19 Apr 2002 19:16:23 -0000	1.718
  @@ -1,4 +1,7 @@
   Changes with Apache 2.0.36
  +  *) Moved the call to apr_mmap_dup outside the error branch so
  +     that it would actually get called. This fixes a core dump
  +     at init everytime you use the MMapFile directive. [Paul J. Reder]
   
     *) Trigger an error when a LoadModule directive attempts to
        load a module which is built-in.  This is a common error when
  
  
  
  1.71      +9 -9      httpd-2.0/modules/cache/mod_file_cache.c
  
  Index: mod_file_cache.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/cache/mod_file_cache.c,v
  retrieving revision 1.70
  retrieving revision 1.71
  diff -u -r1.70 -r1.71
  --- mod_file_cache.c	29 Mar 2002 08:17:20 -0000	1.70
  +++ mod_file_cache.c	19 Apr 2002 19:16:23 -0000	1.71
  @@ -244,20 +244,20 @@
                                     (apr_size_t)new_file->finfo.size,
                                     APR_MMAP_READ, cmd->pool)) != APR_SUCCESS) { 
               apr_file_close(fd);
  -            /* We want to cache an apr_mmap_t that's marked as "non-owner"
  -             * to pass to each request so that mmap_setaside()'s call to
  -             * apr_mmap_dup() will never try to move the apr_mmap_t to a
  -             * different pool.  This apr_mmap_t is already going to live
  -             * longer than any request, but mmap_setaside() has no way to
  -             * know that because it's allocated out of cmd->pool,
  -             * which is disjoint from r->pool.
  -             */
  -            apr_mmap_dup(&new_file->mm, mm, cmd->pool, 0);
               ap_log_error(APLOG_MARK, APLOG_WARNING, rc, cmd->server,
                            "mod_file_cache: unable to mmap %s, skipping", filename);
               return;
           }
           apr_file_close(fd);
  +        /* We want to cache an apr_mmap_t that's marked as "non-owner"
  +         * to pass to each request so that mmap_setaside()'s call to
  +         * apr_mmap_dup() will never try to move the apr_mmap_t to a
  +         * different pool.  This apr_mmap_t is already going to live
  +         * longer than any request, but mmap_setaside() has no way to
  +         * know that because it's allocated out of cmd->pool,
  +         * which is disjoint from r->pool.
  +         */
  +        apr_mmap_dup(&new_file->mm, mm, cmd->pool, 0);
           new_file->is_mmapped = TRUE;
       }
   #endif
  
  
  

Re: cvs commit: httpd-2.0/modules/cache mod_file_cache.c

Posted by Cliff Woolley <jw...@virginia.edu>.
On 19 Apr 2002 rederpj@apache.org wrote:

> rederpj     02/04/19 12:16:23
>
>   Modified:    .        CHANGES
>                modules/cache mod_file_cache.c
>   Log:
>    Moved the call to apr_mmap_dup outside the error branch so
>    that it would actually get called. This fixes a core dump
>    at init everytime you use the MMapFile directive. [Paul J. Reder]

Whoops!  :)  Thanks Paul, good catch.  I don't know how that slipped by
for so long....

--Cliff


--------------------------------------------------------------
   Cliff Woolley
   cliffwoolley@yahoo.com
   Charlottesville, VA