Return-Path: Mailing-List: contact modperl-help@apache.org; run by ezmlm Delivered-To: mailing list modperl@apache.org Received: (qmail 6873 invoked from network); 1 Mar 2000 19:51:56 -0000 Received: from mta1.snfc21.pbi.net (206.13.28.122) by locus.apache.org with SMTP; 1 Mar 2000 19:51:56 -0000 Received: from CHRIS ([209.233.21.159]) by mta1.snfc21.pbi.net (Sun Internet Mail Server sims.3.5.1999.09.16.21.57.p8) with SMTP id <0FQR00EAHDPALU@mta1.snfc21.pbi.net> for modperl@apache.org; Wed, 1 Mar 2000 11:48:46 -0800 (PST) Date: Wed, 01 Mar 2000 11:50:53 -0800 From: Chris Nokleberg Subject: RE: speaking of $SIG{__DIE__} In-reply-to: <3.0.3.32.20000301080452.0139b89c@fpage3.ba.best.com> To: modperl@apache.org Cc: Bill Moseley Message-id: MIME-version: 1.0 X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) Content-type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Importance: Normal X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.5600 X-Priority: 3 (Normal) X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N 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.