Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:21984 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8374 invoked by uid 1010); 22 Feb 2006 07:04:29 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 8359 invoked from network); 22 Feb 2006 07:04:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Feb 2006 07:04:29 -0000 X-Host-Fingerprint: 213.46.255.17 viefep16-int.chello.at Solaris 8 (1) Received: from ([213.46.255.17:4497] helo=viefep16-int.chello.at) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 56/48-50685-BFC0CF34 for ; Wed, 22 Feb 2006 02:04:28 -0500 Received: from genuine ([80.108.128.16]) by viefep16-int.chello.at (InterMail vM.6.01.04.04 201-2131-118-104-20050224) with ESMTP id <20060222070423.NWO2804.viefep16-int.chello.at@genuine>; Wed, 22 Feb 2006 08:04:23 +0100 Received: from [213.164.23.137] (helo=[10.15.10.17]) by genuine with esmtpa (Exim 4.50) id 1FBo2W-0005QH-1J; Wed, 22 Feb 2006 08:04:00 +0100 Message-ID: <43FC0CEB.7000408@fischer.name> Date: Wed, 22 Feb 2006 08:04:11 +0100 User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Ilia Alshanetsky CC: Nuno Lopes , PHPdev , rasmus@lerdorf.com References: <005101c6373a$a6ef0170$0100a8c0@pc07653> <43FB9D99.5070302@prohost.org> In-Reply-To: <43FB9D99.5070302@prohost.org> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Spam-Score: 0 X-Spam-Level: / X-Spam-Report: Spam detection software, running on the system "genuine", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, [response is at the bottom] [...] Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- Subject: Re: [PHP-DEV] recover from a segfault From: markus@fischer.name (Markus Fischer) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, [response is at the bottom] Ilia Alshanetsky wrote: > Nuno Lopes wrote: >> In the last days I've exchanged some e-mails with PCRE's author >> because of one more bug that appeared in our database about segfaults >> in PCRE (related to stack overflows). >> PCRE can consume a lot of stack, because of backtracking (thus >> segfaulting PHP). Yesterday I've discovered that when using the >> setrlimit() function, most segfaults can be avoided >> (http://mega.ist.utl.pt/~ncpl/php_pcre_stack_limits.txt) :) > > This sounds like an interesting idea, I think we need to consider it > doing for PHP in general rather then jut when PCRE is being used. The > only thing is that rather then setting the stack to infinity, perhaps a > small value can be used ;-) > >> I've done a little program for fun to show myself how to catch the >> SIGSEGV signals and print a nice message. >> (http://mega.ist.utl.pt/~ncpl/break-stack.html) >> >> So, catching the signal is easy. What about recovery? Doesn't anyone >> has experience in this area? Can this be done? (and in most >> SAPIs/architectures?) >> > > After SEGV or any memory problem has happened the situation is > undefined. Another words you cannot reliably continue the operation of > the program. Which is why termination and dumping of core is the lesser > of all evils in this case. Would this "reliable execution" also apply to creating the stack overflow message and passing it the PHPs error handler? I was just two days ago that we had, of course, an infinite recursion bug in our software, but the application just segfaults. The hard part was to find where it segfaults. If it would just give a tiny hint as to where the problem might be, this would be so awesome (if, of course, technical possible/feasable). - - Markus -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.1 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFD/Azr1nS0RcInK9ARAk0KAJ4wnL2pRypacl0dqFjr2Bb5EN81KwCcDmKu kiMDEVP6pB/jYov1DCB7JSU= =zxbn -----END PGP SIGNATURE-----