perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Rolsky <>
Subject Re: Bad fix for "fix "PerlSetVar Foo 0" so that $r->dir_config('Foo') returns 0, not undef" in dev tree
Date Tue, 09 Mar 2004 05:07:39 GMT
On Mon, 8 Mar 2004, Geoffrey Young wrote:

> Dave Rolsky wrote:
> > So this change was incorporated in the latest Debian apache-perl package,
> > and it causes segfaults when used with Mason.
> do you have a backtrace, perl version, etc?  has it been reported with
> multiple perl versions?

I've only tested with Perl 5.8.3, threaded.  See this bug report that
someone else filed for the Debian apache-perl package:

Looks like they're running unstable as well, so they'll have Perl 5.8.3
(threaded) as well.

> > The trigger seems to be the fact that Mason includes this bit of code
> > which _may_ be called at server startup:
> >
> >             my $c = $r ? $r : Apache->server;
> >             @val = HAS_TABLE_API ? $c->dir_config->get($p) : $c->dir_config($p);
> does it matter which form you use if PERL_TABLE_API is enabled?

Yes, if table api isn't enabled then dir_config just returns a hash,

> what is the status of your config?  I'm assuming that $c is an
> Apache::Server object and not $r.  Do you actually have a per-server
> PerlSetVar at all, PerlSetVar foo 0, or PerlSetVar foo bar?

This happens at server startup, so $c would be an Apache::Server object.
In my case, the key it's looking for does not exist in the config at all.
I bet if I set it the problem would go away.

> > -    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.

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.


House Absolute Consulting

Report problems:
Mail list info:
List etiquette:

View raw message