httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: memory leak in mod_slotmem_shm
Date Mon, 27 Sep 2010 15:54:42 GMT

On Sep 27, 2010, at 10:28 AM, Stefan Fritsch wrote:

> 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.

Yeppers. That's true.

> 
> 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.
> 

Hmmmm...

> 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.
> 

That's an interesting point. I always assumed that it *should* be,
since one use for it would be as a scoreboard-like replacement
(and the pain for the scoreboard is that it's a set size)...
But I can also see reasons for it to NOT be cleaned/recreated...
How best to handle that??

Mime
View raw message