You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Boysenberry Payne <bo...@humaniteque.com> on 2005/08/17 21:05:31 UTC

Apache (mod_perl) restart issues

When I restart apache I get the following errors on child processes:

child process 424 did not exit, sending another SIGHUP

One for each child process.  After the above I get:

SIGHUP received.  Attempting to restart

I'm using mod_perl 1.26 and apache 1.3.33 (only happens with my 
mod_perl scripts running)

I thought at first it was DBI connections not getting closed properly, 
they seem to be fine though.

I'm not exactly sure how to go about tracking down what's preventing 
the original SIGHUP.

Any ideas?

Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com


Re: Apache (mod_perl) restart issues

Posted by Boysenberry Payne <bo...@humaniteque.com>.
On Aug 19, 2005, at 6:45 PM, Todd Finney wrote:

> perldoc perldiag

Attempt to free unreferenced scalar
            (W internal) Perl went to decrement the reference count of a 
scalar
            to see if it would go to 0, and discovered that it had 
already gone
            to 0 earlier, and should have been freed, and in fact, 
probably was
            freed.  This could indicate that SvREFCNT_dec() was called 
too many
            times, or that SvREFCNT_inc() was called too few times, or 
that the
            SV was mortalized when it shouldn't have been, or that 
memory has
            been corrupted.

For someone like me ( 4 months of perl experience ) this is rather hard 
to make
heads or tails of.  Until 4 months ago I was a php guy. I imagine this 
is during the
"clean up" phase of mod_perl shutting down since this is when I get the 
errors.
So here is what doesn't make sense to me:

How do I trace which references are having it happen?
What does a scalar being mortalized mean?
How can I tell if the memory is being currupted?
And, since this is on a server I can ssh into, but don't have root 
access for
how can I go about debugging it the best without causing my host too 
much
of a headache?

Thanks for all the help,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com


STDOUT clones in mod_perl

Posted by David Scott <ds...@earthlink.net>.
I've been trying to pass the STDOUT filehandle to subroutines, with 
mixed success.  Seems I should be able to do:

my $fh = \*STDOUT;
my_sub( $fh );

where my_sub is:

sub my_sub {
    my ( $fh ) = @_;
    print $fh "foobar\n";
}

I'm not getting any output at all, in fact the Apache process blocks.

Also,

tie $fh, ref $r, $r

complains that TIESCALAR can't be found in class Apache, although this 
is supposed to work.

I'm using Apache 1.3.27 and mod_perl 1.

Any ideas?

David

Re: Apache (mod_perl) restart issues

Posted by Todd Finney <tf...@boygenius.com>.
At 06:37 PM 8/19/2005 -0500, Boysenberry Payne wrote:
>On OSX 10.3.9:
>perl5 (revision 5.0 version 8 subversion 1 RC3)
>mod_perl 1.26 / apache 1.3.33
>
>In error_log as:
>[warn] child process 1354 still did not exit, sending a SIGTERM
>for each child process then finally:
>[notice] caught SIGTERM, shutting down
>regardless of whether it's a restart or stop command

[http://modperlbook.org/html/ch05_03.html]

>On External Linux 2.4.21-32.0.1.EL:
>perl5 (revision 5.0 version 8 subversion 0)
>mod_perl 1.26 / apache 1.3.33
>
>In the error_log as:
>null: Attempt to free unreferenced scalar.

perldoc perldiag covers this particular error message.



Re: Apache (mod_perl) restart issues

Posted by Boysenberry Payne <bo...@humaniteque.com>.
On Aug 19, 2005, at 4:10 PM, Philip M. Gollucci wrote:

> I believe what you are seeing is a known bug in the Apache 1.3.x/mp1 
> series.
>
> I don't think its your code.
>
> I believe google searches will yeild this; I know I've seen it before.

I've found a lot of people mentioning similar errors when I search via 
google.
I haven't found out whether it's something that's a real concern or not.
Nor mention of a specific bug.

How can I find a list of known bugs?
I seem to be having two, probably from the same thing, but
appearing different on each platform.

On OSX 10.3.9:
perl5 (revision 5.0 version 8 subversion 1 RC3)
mod_perl 1.26 / apache 1.3.33

In error_log as:
[warn] child process 1354 still did not exit, sending a SIGTERM
for each child process then finally:
[notice] caught SIGTERM, shutting down
regardless of whether it's a restart or stop command


On External Linux 2.4.21-32.0.1.EL:
perl5 (revision 5.0 version 8 subversion 0)
mod_perl 1.26 / apache 1.3.33

In the error_log as:
null: Attempt to free unreferenced scalar.
It's setup on a cron job to restart at a regular interval during 
development.
It gets a whole mess of the errors, 5 child processes worth.

I think they might go away with warnings off right?  Either way it makes
me wonder what I should do about it?

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com


Re: Apache (mod_perl) restart issues

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Boysenberry Payne wrote:
> So I figured out how to get the perl debugger working with mod_perl, 
> thanks to
> Practical mod_perl.  I still don't know how to track down the scalars 
>> [Sun Feb 13 01:00:00 2000] null: Attempt to free unreferenced scalar.
>> ...<snip>
>>> I'm using mod_perl 1.26 and apache 1.3.33 (only happens with my 
>>> mod_perl scripts running)

I believe what you are seeing is a known bug in the Apache 1.3.x/mp1 
series.

I don't think its your code.

I believe google searches will yeild this; I know I've seen it before.

-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com


Re: Apache (mod_perl) restart issues

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2005-08-19 at 18:40 -0500, Boysenberry Payne wrote:
> I turned off both:
> 
> PerlFreshRestart On

Don't ever use that.

> PerlModule Apache::StatINC
> PerlInitHandler Apache::StatINC

Only use that in development, not on a production server.
Apache::Reload is the newer and better version.

- Perrin


Re: Apache (mod_perl) restart issues

Posted by Boysenberry Payne <bo...@humaniteque.com>.
I turned off both:

PerlFreshRestart On

PerlModule Apache::StatINC
PerlInitHandler Apache::StatINC

on the Linux server and still get the errors.
I'm going to look into Devel::Leak and Devel::LeakTrace

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Aug 19, 2005, at 4:12 PM, Perrin Harkins wrote:

> On Fri, 2005-08-19 at 16:02 -0500, Boysenberry Payne wrote:
>> I still don't know how to track down the scalars
>> being leaked.
>> Could they be being caused from something like the following?
>>
>> sub example {
>> 	return 1;
>> }
>> example;
>
> No, I don't think so.  You can try using things like Devel::Leak and
> Devel::LeakTrace to find the problem.  I've never used them personally.
>
> I always do "apachectl stop && apachectl start" to restart my servers.
> Graceful restarts don't work well on all systems and sometimes cause
> memory leaks.
>
> - Perrin
>
>
>


Re: Apache (mod_perl) restart issues

Posted by Perrin Harkins <pe...@elem.com>.
On Fri, 2005-08-19 at 16:02 -0500, Boysenberry Payne wrote:
> I still don't know how to track down the scalars 
> being leaked.
> Could they be being caused from something like the following?
> 
> sub example {
> 	return 1;
> }
> example;

No, I don't think so.  You can try using things like Devel::Leak and
Devel::LeakTrace to find the problem.  I've never used them personally.

I always do "apachectl stop && apachectl start" to restart my servers.
Graceful restarts don't work well on all systems and sometimes cause
memory leaks.

- Perrin


Re: Apache (mod_perl) restart issues

Posted by Boysenberry Payne <bo...@humaniteque.com>.
So I figured out how to get the perl debugger working with mod_perl, 
thanks to
Practical mod_perl.  I still don't know how to track down the scalars 
being leaked.
Could they be being caused from something like the following?

sub example {
	return 1;
}
example;

Because the the void context of the returned value?  Maybe I'm 
confused...

On the advise of someone on another list I stripped my code down to 
just the handler
and I still get restart errors on my OS X box, which is the only server 
of the two I have
root access on.

Another oddity, on the OSX box I only get the errors on apachectl 
restart, not
stop or graceful.

Any help would be much appreciated

Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Aug 17, 2005, at 2:46 PM, Boysenberry Payne wrote:

> The last set of errors are happening on my OSX box.
> I get a different set of errors on our Linux server when it restarts:
>
> [Sun Feb 13 01:00:00 2000] null: Attempt to free unreferenced scalar.
> ...<snip>
>
> I get a whole mess of those, then I get:
>
> Scalars leaked: 234
>
> I'm not sure how to go about fixing these error on either server
>
>
> Boysenberry
>
> boysenberrys.com | habitatlife.com | selfgnosis.com
>
> On Aug 17, 2005, at 2:05 PM, Boysenberry Payne wrote:
>
>> When I restart apache I get the following errors on child processes:
>>
>> child process 424 did not exit, sending another SIGHUP
>>
>> One for each child process.  After the above I get:
>>
>> SIGHUP received.  Attempting to restart
>>
>> I'm using mod_perl 1.26 and apache 1.3.33 (only happens with my 
>> mod_perl scripts running)
>>
>> I thought at first it was DBI connections not getting closed 
>> properly, they seem to be fine though.
>>
>> I'm not exactly sure how to go about tracking down what's preventing 
>> the original SIGHUP.
>>
>> Any ideas?
>>
>> Boysenberry
>>
>> boysenberrys.com | habitatlife.com | selfgnosis.com
>>
>>
>>
>
>
>


Re: Apache (mod_perl) restart issues

Posted by Boysenberry Payne <bo...@humaniteque.com>.
The last set of errors are happening on my OSX box.
I get a different set of errors on our Linux server when it restarts:

[Sun Feb 13 01:00:00 2000] null: Attempt to free unreferenced scalar.
...<snip>

I get a whole mess of those, then I get:

Scalars leaked: 234

I'm not sure how to go about fixing these error on either server


Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Aug 17, 2005, at 2:05 PM, Boysenberry Payne wrote:

> When I restart apache I get the following errors on child processes:
>
> child process 424 did not exit, sending another SIGHUP
>
> One for each child process.  After the above I get:
>
> SIGHUP received.  Attempting to restart
>
> I'm using mod_perl 1.26 and apache 1.3.33 (only happens with my 
> mod_perl scripts running)
>
> I thought at first it was DBI connections not getting closed properly, 
> they seem to be fine though.
>
> I'm not exactly sure how to go about tracking down what's preventing 
> the original SIGHUP.
>
> Any ideas?
>
> Boysenberry
>
> boysenberrys.com | habitatlife.com | selfgnosis.com
>
>
>