[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Attempt to free unreferenced scalar.
From:       Pete Ehlke <pde () listserv ! music ! sony ! com>
Date:       1999-06-30 20:13:00
[Download RAW message or body]

Yep, it's the dread "Attempt to free unreferenced scalar." problem,
rearing its head from yet another source...

I've been trying to configure some virtual host sections thusly,
as seen on page 418 of the Eagle:

<Perl>
#!perl

$NameVirtualHost = "192.168.1.1";

$VirtualHost{"$NameVirtualHost"} = [
   {
   ServerName => 'foo.domain.com',
   DocumentRoot => '/usr/local/apache/htdocs/foo'
   },
   {
   ServerName => 'bar.domain.com',
   DocumentRoot => '/usr/local/apache/htdocs/bar'
   },
];
__END__

</Perl>                                 

In order to eliminate the possibility that anything else is causing the
unreferenced scalar problem, I've trimmed my <Perl> section down to
nothing more than this. When testing with ab, I end up with the
dread "Attempt to free unreferenced scalar." error in error_log. It
seems to show up a pseudo-random, but small (~10-15 times/1000 requests)
number of times.

If I take out the array reference, or replace it with something like

push @PerlConfig, <<EOT;

<VirtualHost $interface>
ServerName foo.domain.com
DocumentRoot /usr/local/apache/htdocs/foo
</VirtualHost>
<VirtualHost $interface>
ServerName bar.domain.com
DocumentRoot /usr/local/apache/htdocs/bar
</VirtualHost>     
EOF

then the errors disappear. Note that the server seems to function the
same in all cases; I suspect that the errors are coming when a child
httpd dies.

I've tried this with apache 1.3.6 and mod_perl 1.19 and 1.20, with
perl 5.004_04 and 5.005_02 under both Solaris 2.6 and Red Hat 5.2; the
results are the same in all cases. 

From reading archives of this list, it appears to me that these errors
are really pesky and intractable, but any pointers to obvious problems
or further debugging info I can provide would engender debts of beer
and good karma on my part.

Thanks for any help
-Pete

-- 
Pete Ehlke
Sys Admin type @ Sony Music entertainment
"Once is happenstance, twice is coincidence, three times is enemy action."
  -- Ian Fleming

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic