httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: memory leak
Date Tue, 06 Feb 2001 22:24:29 GMT

> I -think- the problem is in apr_bucket_make_shared.  Here is the scenario...
> 
> apr_bucket_make_file() mallocs an apr_bucket_file and places the apr_file_t
> pointer in it then calls apr_bucket_make_shared()
> 
> apr_bucket_make_shared() mallocs an apr_bucket_shared struct, hangs the
> apr_bucket_file off the apr_bucket_shared than hangs a pointer to the
> apr_bucket_shared struct off the buckets data pointer. Uuugh...
> 
> The problem occurs when Apache does a file_read() on the bucket. file_read
> (apr_buckets_file.c) mmaps the file, then calls apr_bucket_make_shared() which
> repeats the steps above, except hanging an apr_mmap_t off the
> apr_bucket_shared rather than an apr_file_t. The problem is the second
> apr_bucket_shared (mmap) replaces the first one (file), effectively stranding
> the first apr_bucket_shared struct that contains the apr_file_t.
> 
> So, should apr_bucket_make_shared be modified to handle linked lists of shared
> structures?

That sure sounds like the bug.  No, the bucket_make_shared stuff shouldn't
handle linked lists of shared structures.  It should just replace the
shared file with the shared MMAP.

Ryan

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


Mime
View raw message