You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Beheer <be...@interapy.nl> on 2006/09/05 11:53:14 UTC

[MP2] Carp::Confess doesn't traceback

Hello,

We have an modperl2 (1.999.21) application that sometimes gives an
segmentation fault. 

I'm having problems with getting Carp:Confess to work. When apache2
gives an segmentation fault, it only prints one line in the error log,
without the information where the segmentation fault originates. When I
induce an segmentation fault in our application
(Debug::DumpCore::segv();) the traceback works. Does anybody have a clue
how to get a more complete traceback?

Thanks for any help!

------------error log-------

(...)
SEGV traceback at /home/httpd/Application.pm line 138
        Application::__ANON__('SEGV') called at -e line 0
        eval {...} called at -e line 0
(...)

------------code-----------

(133) use Carp;
(134) use POSIX qw(SIGSEGV);
(135)
(136) POSIX::sigaction(
(137)    SIGSEGV,
(138)    POSIX::SigAction->new(sub { confess `date` . ": SEGV
traceback" })) or warn "Error setting SIGSEGV handler: $!\n";

------------system------------

Debian Sarge
Apache 2.0.54-5
Mod-perl2 1.999.21-1










Re: [MP2] Carp::Confess doesn't traceback

Posted by Beheer <be...@interapy.nl>.
> Why do you keep saying "Carp::Confess"? Do you mean "Carp::confess", right?

You are right. I mean (and use in the code) "Carp::confess".




Re: [MP2] Carp::Confess doesn't traceback

Posted by Adriano Ferreira <a....@gmail.com>.
On 9/6/06, Beheer <be...@interapy.nl> wrote:
> On Tue, 2006-09-05 at 09:25 -0300, Adriano Ferreira wrote:
>
> > The issue is: does apache2 reports the segmentation fault with
> > Carp::confess? If this is not the case, that's why you don't see the
> > stack trace information.
>
> Yes, it does use Carp::Confess but stops confessing at the point where
> Carp::Confess is called in the code. It looks like at that point carp
> can't find the referring object (or something like that?).

Why do you keep saying "Carp::Confess"? Do you mean "Carp::confess", right?

$ perl -MCarp -e 'confess("foo")'
foo at -e line 1

$ perl -MCarp -e 'Confess("foo")'
Undefined subroutine &main::Confess called at -e line 1.

Re: [MP2] Carp::Confess doesn't traceback

Posted by Malcolm J Harwood <mj...@liminalflux.net>.
On Wednesday 06 September 2006 07:36, Beheer wrote:

> On Tue, 2006-09-05 at 09:25 -0300, Adriano Ferreira wrote:
> > The issue is: does apache2 reports the segmentation fault with
> > Carp::confess? If this is not the case, that's why you don't see the
> > stack trace information.
>
> Yes, it does use Carp::Confess but stops confessing at the point where
> Carp::Confess is called in the code. It looks like at that point carp
> can't find the referring object (or something like that?).
>
> Anybody a clue?

That sounds pretty normal to me in the case of a seg-fault, especially if the 
seg fault is down below the perl layer (at the XS or apache level). Segfaults 
in C fairly often result in stack trashes.

Re: [MP2] Carp::Confess doesn't traceback

Posted by Beheer <be...@interapy.nl>.
On Tue, 2006-09-05 at 09:25 -0300, Adriano Ferreira wrote:

> The issue is: does apache2 reports the segmentation fault with
> Carp::confess? If this is not the case, that's why you don't see the
> stack trace information.

Yes, it does use Carp::Confess but stops confessing at the point where
Carp::Confess is called in the code. It looks like at that point carp
can't find the referring object (or something like that?). 

Anybody a clue?

------------error log-------

(...)
SEGV traceback at /home/httpd/Application.pm line 138
        Application::__ANON__('SEGV') called at -e line 0
        eval {...} called at -e line 0
(...)

------------code-----------

(133) use Carp;
(134) use POSIX qw(SIGSEGV);
(135)
(136) POSIX::sigaction(
(137)    SIGSEGV,
(138)    POSIX::SigAction->new(sub { confess `date` . ": SEGV
traceback" })) or warn "Error setting SIGSEGV handler: $!\n";

------------system------------

Debian Sarge
Apache 2.0.54-5
Mod-perl2 1.999.21-1





Re: [MP2] Carp::Confess doesn't traceback

Posted by Adriano Ferreira <a....@gmail.com>.
On 9/5/06, Beheer <be...@interapy.nl> wrote:
> We have an modperl2 (1.999.21) application that sometimes gives an
> segmentation fault.
>
> I'm having problems with getting Carp:Confess to work. When apache2
> gives an segmentation fault, it only prints one line in the error log,
> without the information where the segmentation fault originates. When I
> induce an segmentation fault in our application
> (Debug::DumpCore::segv();) the traceback works. Does anybody have a clue
> how to get a more complete traceback?

The issue is: does apache2 reports the segmentation fault with
Carp::confess? If this is not the case, that's why you don't see the
stack trace information.

You may try Carp::Always, though I don't know if it will work within
mod_perl (I never tried it). If it works, it will turn every die/warn
into croak/carp with stack traces. It the segmentation fault is thrown
via die, you may able to see the information you want.

Regards,
Adriano Ferreira.