> From: Branko Cibej [mailto:[EMAIL PROTECTED] > Sent: 19 March 2002 16:14
> Sander Striker wrote: > > >>From: Bill Stoddard [mailto:[EMAIL PROTECTED] > >>Sent: 19 March 2002 05:43 > >> > > > >>>I'm pretty sure I have identified the problem on Windows. The blow up > >>>happens when we > >>>are trying to obtain a mutex that has been freed. This happens on the very > >>>last pool to be > >>>cleaned up (the "global_pool"). In apr_pool_destroy, we call the pool > >>>cleanups (one of > >>>which is for the mutex in the allocator) then call apr_allocator_free() > >>>which proceeds > >>>to attempt to acquire the mutex that was just freed. > >>> > > > >Oh, duh! Why didn't I think of that? > >Thanks for tracking this down Bill. > > > > > >>This hack of a patch eliminates the seg fault. I am not so familier with > >>the pool code and > >>am not inclined to dig into it right now. Perhaps the check to NULL out > >>the mutex should > >>be > >> > >>if (apr_allocator_get_owner(allocator) == pool) { > >> > >>??? > >> > > > >Yes, that is the correct spot. I've committed a patch similar to yours. > > > > That patch doesn't solve the problem. apr_terminate still crashes in the > pool cleanup. Hmmm, reviewing the code again. The patch is basically a noop, since apr_allocator_destroy doesn't even use the lock. Moving the code up a few lines, as in my next commit, will fix it I think. Thanks, Sander
