You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Christian Klinger <ck...@novareto.de> on 2005/09/09 09:24:51 UTC

Segmentation Fault

Hello,

i have a big problem with Segmentation Fault which i can not debug.
I got this Segmentation Fault only in Safari or IE Browsers and not 
always only sometimes. This fact makes it hard for me to debug the error.

Here is my Server Configuration

Apache/2.0.54 (Unix) mod_ssl/2.0.54 OpenSSL/0.9.7g mod_auth_tkt/2.0.0b5 
mod_perl/2.0.1 Perl/v5.8.6 configured -- resuming normal operations

This is the error_log message.
[Fri Sep 09 10:26:43 2005] [notice] child pid 18924 exit signal 
Segmentation fault (11)


Can you give me some tips for debugging this error?

cheers christian


Re: Segmentation Fault

Posted by Christian Klinger <ck...@novareto.de>.
Philip M. Gollucci wrote:
> Christian Klinger wrote:
> 
>> These are the last lines of the error_log
>>
>> ...
>> DB<1> CGI::self_or_default(/usr/lib/perl5/5.8.3/CGI.pm:433):
> 
> Three questions / suggestions,
> 
> 1) You said you were using perl 5.8.6.  Thats loading something 
> installed into perl 5.8.3.  That could be.
> 2) What version of CGI.pm are yousing... If you're not using CGI.pm 3.11 
> upgrade and try again.
> 3) If possibe upgrade PERL to perl 5.8.7 though thats likely not it.
> 
> Based on this part of it
> 
>   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:61):
> 61:         if ($MOD_PERL and not $nph) {
>   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:62):
> 62:             $self->r->send_cgi_header($header);
>   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:377):
> 377:      my $self = shift;
>   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:378):
> 378:      my $r = $self->{'.r'};
>   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:379):
> 379:      $self->{'.r'} = shift if @_;
>   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:380):
> 380:      $r;
>   DB<1> .
> 
> I'd be inclined to blame #2
> 
>   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:62):
> 62:             $self->r->send_cgi_header($header);
> 
> is line 810 for you in CGI.pm 3.11 its 1450 or so... seems like you a 
> really old one.
> 
OK i have installed new perl version. The same Problem.
Is it possible that i dont exit correct from my perl script. And Apache 
lost his threads for every try to access the perl-script?

christian


Re: Segmentation Fault

Posted by Christian Klinger <ck...@novareto.de>.
Philip M. Gollucci wrote:
> Christian Klinger wrote:
> 
>> These are the last lines of the error_log
>>
>> ...
>> DB<1> CGI::self_or_default(/usr/lib/perl5/5.8.3/CGI.pm:433):
> 
> Three questions / suggestions,
> 
> 1) You said you were using perl 5.8.6.  Thats loading something 
> installed into perl 5.8.3.  That could be.

I´ve installed the newest mod_perl but i use the Perl-Package from
Suse-Linux ditribution.
> 2) What version of CGI.pm are yousing... If you're not using CGI.pm 3.11 
> upgrade and try again.
In /usr/lib/perl5/5.8.3/CGI.pm i found these lines
$CGI::revision = '$Id: CGI.pm,v 1.185 2005/08/03 21:14:55 lstein Exp $';
$CGI::VERSION='3.11';

> 3) If possibe upgrade PERL to perl 5.8.7 though thats likely not it.

ok i will try to install the newest perl version.

> 
> Based on this part of it
> 
>   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:61):
> 61:         if ($MOD_PERL and not $nph) {
>   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:62):
> 62:             $self->r->send_cgi_header($header);
>   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:377):
> 377:      my $self = shift;
>   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:378):
> 378:      my $r = $self->{'.r'};
>   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:379):
> 379:      $self->{'.r'} = shift if @_;
>   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:380):
> 380:      $r;
>   DB<1> .
> 
> I'd be inclined to blame #2
> 
>   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:62):
> 62:             $self->r->send_cgi_header($header);
> 
> is line 810 for you in CGI.pm 3.11 its 1450 or so... seems like you a 
> really old one.
> 

I think i have installed the newest CGI.pm.

thx christian


Re: Segmentation Fault

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Christian Klinger wrote:
> These are the last lines of the error_log
> 
> ...
> DB<1> CGI::self_or_default(/usr/lib/perl5/5.8.3/CGI.pm:433):
Three questions / suggestions,

1) You said you were using perl 5.8.6.  Thats loading something installed into perl 5.8.3.  That could be.
2) What version of CGI.pm are yousing... If you're not using CGI.pm 3.11 upgrade and try again.
3) If possibe upgrade PERL to perl 5.8.7 though thats likely not it.

Based on this part of it

   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:61):
61:         if ($MOD_PERL and not $nph) {
   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:62):
62:             $self->r->send_cgi_header($header);
   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:377):
377:      my $self = shift;
   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:378):
378:      my $r = $self->{'.r'};
   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:379):
379:      $self->{'.r'} = shift if @_;
   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:380):
380:      $r;
   DB<1> .

I'd be inclined to blame #2

   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:62):
62:             $self->r->send_cgi_header($header);

is line 810 for you in CGI.pm 3.11 its 1450 or so... seems like you a really old one.

-- 
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: Segmentation Fault

Posted by Christian Klinger <ck...@novareto.de>.
Philip M. Gollucci wrote:
> Christian Klinger wrote:
> 
>> Can you give me some tips for debugging this error?
> 
> You can attach gdb or ddd to the running httpd
> see here:
> 
> http://httpd.apache.org/dev/debugging.html
> 
> and/or
> 
> You can use Apache::DB from CPAN
> to get a PERL debugger for things under mod_perl.
> 
> See Apache::DB's documentation ...
> I have a config handy so here it is:
> 
> in httpd.conf:
> PerlRequire conf/db.pl
> PerlModule Apache::DB
> <Location />
>  SetHandler modperl
>  PerlFixUpHandler Apache::DB
> </Location>
> 
> 
> cat conf/db.pl
> use APR::Pool ();
> use Apache::DB ();
> Apache::DB->init();
> 
> 1;
> 
> If you can't figure it yourself, post a strack trace WITH debugging 
> enabled to the list and we'll look again.
> 
> HTH
> 
> 
Hello agin,

i have enabled your debugging.

Here is the scirpt which raises these error.
...
if ($f == 1)
    {
     success($uid,$pw);
    }
else
    {
     error_exit();
    }


sub error_exit
{
         print STDERR "Exit to error Page \n";
         #print 
$cgi->redirect('https://bgeextranet.cnbg.de/anmeldung/LoginErr.htm');
         print $cgi->header(-location=>"https://192.168.2.11");
         print STDERR "Exit to error Page \n";
         exit;
}


These are the last lines of the error_log

...
DB<1> CGI::self_or_default(/usr/lib/perl5/5.8.3/CGI.pm:433):
433:        unless (defined($_[0]) &&
434:                (ref($_[0]) eq 'CGI' || UNIVERSAL::isa($_[0],'CGI')) 
# slightly optimized for common case
435:                ) {
   DB<1> CGI::self_or_default(/usr/lib/perl5/5.8.3/CGI.pm:439):
439:        return wantarray ? @_ : $Q;
   DB<1> CGI::cache((eval 18)[/usr/lib/perl5/5.8.3/CGI.pm:810]:3):
3:          $new_value = '' unless $new_value;
   DB<1> CGI::cache((eval 18)[/usr/lib/perl5/5.8.3/CGI.pm:810]:4):
4:          if ($new_value ne '') {
   DB<1> CGI::cache((eval 18)[/usr/lib/perl5/5.8.3/CGI.pm:810]:7):
7:          return $self->{'cache'};
   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:57):
57:         push(@header,"Content-Disposition: attachment; 
filename=\"$attachment\"") if $attachment;
   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:58):
58:         push(@header,map {ucfirst $_} @other);
   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:58):
58:         push(@header,map {ucfirst $_} @other);
   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:59):
59:         push(@header,"Content-Type: $type") if $type ne '';
   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:60):
60:         my $header = join($CRLF,@header)."${CRLF}${CRLF}";
   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:61):
61:         if ($MOD_PERL and not $nph) {
   DB<1> CGI::header((eval 16)[/usr/lib/perl5/5.8.3/CGI.pm:810]:62):
62:             $self->r->send_cgi_header($header);
   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:377):
377:      my $self = shift;
   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:378):
378:      my $r = $self->{'.r'};
   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:379):
379:      $self->{'.r'} = shift if @_;
   DB<1> CGI::r(/usr/lib/perl5/5.8.3/CGI.pm:380):
380:      $r;
   DB<1> .

###########################################################################
I see in mod_forensic that these request is not "responded"

+6iY7e8CoAgsAACj3ST0AAAAE|POST /anmeldung/perl/bg30auth.pl 
HTTP/1.1|Accept:*/*|Accept-Language:de-de, ja;q=0.85, en;q=0.92, 
ja-jp;q=0.88, de;q=0.96, fr;q=0.81, es;q=0.77, it-it;q=0.73, it;q=0.69, 
nl-nl;q=0.65, nl;q=0.62, sv-se;q=0.58, sv;q=0.54, no-no;q=0.50, 
no;q=0.46, da-dk;q=0.42, da;q=0.38, fi-fi;q=0.35, 
fi;q=0.31|Accept-Encoding:gzip, deflate;q=1.0, identity;q=0.5, 
*;q=0|Referer:https%3a//192.168.2.11/anmeldung/Login.htm?back=https%253a%252f%252f192.168.2.11%252f|User-Agent:Mozilla/5.0 
(Macintosh; U; PPC Mac OS X; de-de) AppleWebKit/125.2 (KHTML, like 
Gecko) 
Safari/125.7|Content-Type:application/x-www-form-urlencoded|Content-Length:8|Connection:close|Host:192.168.2.11



Re: Segmentation Fault

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Christian Klinger wrote:
> Can you give me some tips for debugging this error?
You can attach gdb or ddd to the running httpd
see here:

http://httpd.apache.org/dev/debugging.html

and/or

You can use Apache::DB from CPAN
to get a PERL debugger for things under mod_perl.

See Apache::DB's documentation ...
I have a config handy so here it is:

in httpd.conf:
PerlRequire conf/db.pl
PerlModule Apache::DB
<Location />
  SetHandler modperl
  PerlFixUpHandler Apache::DB
</Location>


cat conf/db.pl
use APR::Pool ();
use Apache::DB ();
Apache::DB->init();

1;

If you can't figure it yourself, post a strack trace WITH debugging enabled to the list and we'll look again.

HTH


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