>>>-    if (!SvTRUE(RETVAL)) {
>>>+    if (!SvOK(RETVAL)) {
>>
>>I don't see how that could cause a segfault at first glance - it ought to
>>only affect "0" cases, so if you don't qualify the results ought to be the
>>same...
> 
> 
> Yeah, you'd think.
> 
> I'm quite sure this is the culprit, though.  I recompiled from the Debian
> source, but removed this one patch, and now there's no segfault.

blargh.  I did discuss this with rafael before implementing it, and (if
memory serves) he assured me that SvOK is the canonical way to test for
defined SVs, equivalent to perl's defined() which is just what we need..
SvTRUE is clearly wrong, as the original bug report showed, but it
apparently has additional side effects we need :)

anyway, perl's define() looks like this (in pp.c)

        if (SvGMAGICAL(sv))
            mg_get(sv);
        if (SvOK(sv))
            RETPUSHYES;

so, aside from the magic...

> 
> The reproduction recipe should be pretty simple, simply add this to your
> mod_perl config:
> 
>   PerlModule  HTML::Mason::ApacheHandler
> 
> Any recent of version of Mason should do, though I have 1.25 (well, really
> 1.26-to-be) installed here.

my hacking is limited this week, but I'll try to install mason and reproduce
tomorrow.  in the meanwhile, please try this (untested) patch, just in case
there's magic lying around (dir_config does return a tied hash iirc).  it's
just a shot in the dark, but until I can trace things more than I already
have, or get some additonal feedback from p5p gurus, it will have to do :)

--Geoff


Index: src/modules/perl/Apache.xs
===================================================================
RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
retrieving revision 1.130
diff -u -r1.130 Apache.xs
--- src/modules/perl/Apache.xs  1 Dec 2003 17:30:19 -0000       1.130
+++ src/modules/perl/Apache.xs  9 Mar 2004 06:05:05 -0000
@@ -2084,6 +2084,9 @@
                                                 &perl_module);
        TABLE_GET_SET(c->vars, FALSE);
     }
+
+    SvGETMAGIC(RETVAL);
+
     if (!SvOK(RETVAL)) {
        s = r && r->server ? r->server : perl_get_startup_server();
        if (s && s->module_config) {

-- 
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html

Reply via email to