Within the listener thread of the worker MPM, the ptrans pool passed
that's created for each connection--and handed off to a worker thread--
is a child of the thread pool for the listener thread:
static void *listener_thread(apr_thread_t *thd, void * dummy)
{
proc_info * ti = dummy;
int process_slot = ti->pid;
int thread_slot = ti->tid;
apr_pool_t *tpool = apr_thread_pool_get(thd);
...
got_fd:
if (!workers_may_exit) {
/* create a new transaction pool for each accepted socket */
apr_pool_create_ex(&ptrans, tpool, NULL,
APR_POOL_FNEW_ALLOCATOR);
apr_pool_tag(ptrans, "transaction");
That's why we get a segv during graceful shutdown. The listener
thread exits almost immediately, and during the thread cleanup its
pool is destroyed. Before going away, this pool recursively
destroys its children--including the transaction pools being used
by any outstanding worker threads.
Is there any reason why the ptrans pool needs to be a child of
tpool? If we can use a null parent for ptrans, this problem should
go away.
--Brian