[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#711213: libapache2-mod-perl2: occasional core dumps after the test suite



On Fri, Jun 14, 2013 at 10:24:07AM +0200, Stefan Fritsch wrote:
 
> The problem is that MP_CMD_SRV_DECLARE2(authz_provider) and 
> MP_CMD_SRV_DECLARE2(authn_provider) register the cleanup against 
> parms->server->process->pool which lives longer than the pconf pool 
> and therefore the load time of the mod-perl shared object. It should 
> probably use parms->pool (which is pconf) instead.

> Now, if there is a good reason that the above functions use server-
> >process->pool, we need to figure out a way to fix that. But the 
> original commit of that code has no comment with respect to the pool 
> requirement. Therefore I think it may be simply a bug and you should 
> test it with a cleanup against pconf, first.

Thanks! The attached patch indeed fixes the problem for me without
introducing any new regressions in the test suite.

@pkg-perl: I'm away from my keys ATM; could somebody please upload
this? The ia64 problem (#711167) is still a mystery but I have high
hopes this at least fixes the armel buildd crashes.
-- 
Niko Tyni   ntyni@debian.org
>From 75662f4285bad8d28fe787d1293bdd95a535cad1 Mon Sep 17 00:00:00 2001
From: Niko Tyni <ntyni@debian.org>
Date: Fri, 14 Jun 2013 14:07:22 +0300
Subject: [PATCH] Make sure authn and authz providers are cleaned up in time

The authn and authz providers need to be registered in the configuration
pool rather than the server process pool.  The latter outlives the load
time of the mod_perl shared object, so cleanup hooks could get called
after the registered functions were unloaded, causing SIGSEGVs and other
undefined behaviour.

Fix suggested by Stefan Fritsch.

Bug-Debian: http://bugs.debian.org/711213
---
 src/modules/perl/modperl_cmd.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/perl/modperl_cmd.c b/src/modules/perl/modperl_cmd.c
index 4ae0a62..d14b330 100644
--- a/src/modules/perl/modperl_cmd.c
+++ b/src/modules/perl/modperl_cmd.c
@@ -419,7 +419,7 @@ MP_CMD_SRV_DECLARE(init_handlers)
 
 MP_CMD_SRV_DECLARE2(authz_provider)
 {
-    apr_pool_t *p = parms->server->process->pool;
+    apr_pool_t *p = parms->pool;
     char *name = apr_pstrdup(p, arg1);
     char *cb = apr_pstrdup(p, arg2);
 
@@ -431,7 +431,7 @@ MP_CMD_SRV_DECLARE2(authz_provider)
 
 MP_CMD_SRV_DECLARE2(authn_provider)
 {
-    apr_pool_t *p = parms->server->process->pool;
+    apr_pool_t *p = parms->pool;
     char *name = apr_pstrdup(p, arg1);
     char *cb = apr_pstrdup(p, arg2);
 
-- 
1.7.10.4


Reply to: