apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@covalent.net
Subject Re: APR Bug or misunderstanding ?
Date Sat, 06 Jan 2001 01:04:01 GMT
On Fri, 5 Jan 2001 rbb@covalent.net wrote:

> 
> (Copied to dev@apr.apache.org, which is the APR development mailing list.)
> 
> >     I've been having a look at the new APR library on NT. To cut a long story short
> > I ended up with a program that did: apr_initialize() followed immediately by
> > apr_terminate(). The program blew up in the terminate call.
> >     After some checking I found that the poblem appeared the following:
> >         apr_term_alloc() destroyes the alloc_mutex and then issues
> > apr_destroy_pool(globalp);
> >     Now inside apr_destroy_pool() it attempted to acquire the alloc_mutex lock.
> > This had already been destroyed, hence the system (rightly) complained.
> >     I inverted the order of the operations in apr_term_alloc() so that the pool
is
> > destroyed before the mutexes are destroyed.
> 
> #1.  Thank you for diagnosing this problem.  I have not seen it, but
> having reviewed the code, you are 100% correct.  Your solution is slightly
> flawed, but I am about to commit a different fix.
> 
> The fix I will commit instead, will check to ensure that there are locks
> when we destroy a pool.  This will add two if's to the destroy_pool call,
> but I believe this is the safer option.

Hmmmm..... I have just looked at the code in more detail, we have already
an "if (alloc_mutex {" check both before locking and unlocking the
mutex.  This means that we shouldn't be seg faulting.  When did you grab
your copy of APR?  Do you have the if calls in your copy?

Ryan

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


Mime
View raw message