httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch ...@sfritsch.de>
Subject Re: memory leak in mod_slotmem_shm
Date Mon, 27 Sep 2010 14:28:01 GMT
On Monday 27 September 2010, Jim Jagielski wrote:
> On Sep 27, 2010, at 9:19 AM, Jim Jagielski wrote:
> > On Sep 27, 2010, at 8:17 AM, Jim Jagielski wrote:
> >> Let me look...
> >> 
> >> On Sep 26, 2010, at 12:13 PM, Stefan Fritsch wrote:
> >>> Hi,
> >>> 
> >>> mod_slotmem_shm creates a new global pool on every graceful
> >>> restart but never destroys it.
> >>> 
> >>> From quickly looking at the code it is not clear to me what the
> >>> correct behaviour would be. Should the pool be created from
> >>> pconf instead? Or should it be destroyed in cleanup_slotmem()?
> > 
> > creating from pconf is cleaner...
> 
> Hold on a tic... I'm not seeing the leak. During
> cleanup_slotmem we do destroy next->gpool which
> is set to gpool.

Hmm. There seem to be two issues here:

If no other module uses shm slotmem (i.e. slotmem_create() is never 
called), globallistmem stays NULL and the cleanup does nothing. In 
this case gpool is leaked every time.

The pool is created on every call to pre_config, but the cleanup is 
registered only on the second and subsequent calls to post_config. In 
this case only the first gpool is leaked.

BTW, it is not that obvious that the shm is supposed to be cleaned up 
and re-created on graceful restarts. This should be documented in the 
code.

Mime
View raw message