perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Nokleberg <ch...@sportsrocket.com>
Subject RE: speaking of $SIG{__DIE__}
Date Wed, 01 Mar 2000 19:50:53 GMT
I've run into this exit-in-SIGDIE-POPSTACK problem before, and wasn't using
CGI.pm. It is a bug in Perl that I believe has been fixed in the
development versions.

It is not guaranteed to happen, and I managed to get it to work without
errors eventually, but it required changing a lot of my error handling
code; you'll probably have to mess with the internals of CGI.pm.

Chris

> -----Original Message-----
> From: Bill Moseley [mailto:moseley@hank.org]
> Sent: Wednesday, March 01, 2000 8:05 AM
> To: Doug MacEachern
> Cc: modperl@apache.org
> Subject: Re: speaking of $SIG{__DIE__}
>
>
> At 11:28 PM 02/29/00 -0800, Doug MacEachern wrote:
> >On Wed, 23 Feb 2000, Bill Moseley wrote:
> >
> >> Apache::RegistryNG script:  mod_perl-1.21 Apache 1.3.11
> Solaris 2.6 perl
> >> 5.00503
> >>
> >> I though this a bit interesting:
> >>
> >> I use a $SIG{__DIE__} handler that prints a nice message and
> then calls
> exit.
> >>
> >> One thing I noticed that if I use CGI.pm to write that nice
> message that
> >> the Apache child dies after calling exit.  If I just use print() (with
> >> PerlSendHeader on) it works fine and the Apache child lives
> on to serve
> >> another request.
> >>
> >> Seems to do the same thing with $SIG{__WARN__}.
> >>
> >> This is error_log
> >> panic: POPSTACK
> >> Callback called exit.
> >>
> >> #!/usr/local/bin/perl5.00503 -wT
> >> use strict;
> >>
> >> use CGI;
> >> use Apache;
> >>
> >> $SIG{__DIE__} =
> >>     sub {
> >>         print CGI::header(),
> >> #        print "Content-type: text/plain\n\n",
> >>         "Child $$\n";
> >>         Apache->exit;
> >
> >why do you call Apache->exit here?  try removing it.
>
> It should be ok to exit in a __DIE__ handler.  That's what perlvar says.
>
> If you don't call exit() then Apache generates its own error
> message, which
> is what I'm trying to override.  I think this is more  CGI.pm issue.



Mime
View raw message