On Sunday 06 May 2007 19:11, Torsten Foertsch wrote:
> I am in the middle of the analysis of a segfault. The segfault happens in a
> $r->push_handlers(PerlFixupHandler=>sub{}). Unfortunately it happens not
> for every request but after 13. Finally, I think I have tracked it down to
> something to talk about.

The attached patch fixes that. The problem was that with an already 
initialized rcfg (ravp && *ravp == true) but no handler configured in dcfg a 
pointer allocated from r->pool was saved in dcfg.

That happens if there is no handler configured at startup time but more than 
one for the same phase at request time.

Torsten
Index: src/modules/perl/modperl_handler.c
===================================================================
--- src/modules/perl/modperl_handler.c	(revision 535867)
+++ src/modules/perl/modperl_handler.c	(working copy)
@@ -428,6 +428,7 @@
         break;
       case MP_HANDLER_ACTION_PUSH:
         if (ravp && !*ravp) {
+	    /* initialize ravp either from avp or as an empty array */
             if (*avp) {
                 /* merge with existing configured handlers */
                 *ravp = apr_array_copy(p, *avp);
@@ -437,6 +438,9 @@
                 *ravp = modperl_handler_array_new(p);
             }
         }
+        else if (ravp /* && *ravp */) {
+	    /* ravp is already initialized: do nothing */
+        }
         else if (!*avp) {
             /* directly modify the configuration at startup time */
             *avp = modperl_handler_array_new(p);

Attachment: pgpq7nJ8vfF0M.pgp
Description: PGP signature

Reply via email to