apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sander Striker" <stri...@apache.org>
Subject RE: pool debug question.
Date Wed, 04 Sep 2002 07:38:49 GMT
> From: Ian Holsman [mailto:ianh@apache.org]
> Sent: 04 September 2002 05:42

> hi all.
> I've got a piece of multi-threaded code which runs fine
> until it gets to the apr_terminate, where it segfaults in
> apr_allocator_destroy.
> any hints on what is going on ?

apr_initialize calls apr_pool_initialize which creates a
global allocator which is used for all pools (unless overridden).
The global allocator is protected by a mutex, which is allocated
out of the global pool (also created by apr_pool_initialize).

apr_terminate calls apr_pool_terminate which in turn destroys
the global pool.  The global pool is the owner of the global
allocator and thus destroys the global allocator after its own
destruction.  The global pool cleanup _should_ already have
taken care of the destruction of the mutex and the resetting of
the mutex field of the global allocator.

> the test program is creating and destroying thousands of pools
> but is not messing at all with allocators

Are you sure you are not calling apr_terminate before all threads
have finished?  If you are we have a nice thing to debug :(


View raw message