Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12697 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78026 invoked by uid 1010); 10 Sep 2004 05:58:17 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 77888 invoked from network); 10 Sep 2004 05:58:16 -0000 Received: from unknown (HELO smtp.unet.ru) (213.219.244.56) by pb1.pair.com with SMTP; 10 Sep 2004 05:58:16 -0000 Received: from host.phpclub.net by smtp.unet.ru (8.12.9/Unet) with ESMTP id i8A5wFqR098024 for ; Fri, 10 Sep 2004 09:58:15 +0400 (MSD) Received: from s17.hibet.ru by host.phpclub.net (8.12.6/Unet) with ESMTP id i8A5wFHN027202 for ; Fri, 10 Sep 2004 09:58:15 +0400 (MSD) Date: Fri, 10 Sep 2004 09:57:25 +0400 To: php-dev Message-ID: <20040910095725.257bcb8e.tony2001@phpclub.net> X-Mailer: Sylpheed version 0.9.12 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart=_Fri__10_Sep_2004_09_57_25_+0400_V4PlmZw_8wNxFPoa" Subject: [patch] Zend/zend_objects_API.c - bug #29980 (segfault while executing __destruct()) From: tony2001@phpclub.net (Antony Dovgal) --Multipart=_Fri__10_Sep_2004_09_57_25_+0400_V4PlmZw_8wNxFPoa Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit And the last one, the most questionable patch. ATM ZE2 calls destructor at the end of the request and no matter is there were a fatal error (which should probably stop executing the script). In some cases it leads to nasty segfaults (me and report's author can reproduce it, but others can't. weird..). Some persons (hello, Andrey =)) think that this could be a useful feature, but for me it's just an inconsistency. IMO destructors should not be called after fatal errors, because they can cause even more harm. -- Wbr, Antony Dovgal aka tony2001 tony2001@phpclub.net || antony@dovgal.com --Multipart=_Fri__10_Sep_2004_09_57_25_+0400_V4PlmZw_8wNxFPoa Content-Type: text/plain; name="bug29980.diff.txt" Content-Disposition: attachment; filename="bug29980.diff.txt" Content-Transfer-Encoding: 7bit Index: zend_objects_API.c =================================================================== RCS file: /repository/ZendEngine2/zend_objects_API.c,v retrieving revision 1.42 diff -u -r1.42 zend_objects_API.c --- zend_objects_API.c 25 Jul 2004 17:25:44 -0000 1.42 +++ zend_objects_API.c 6 Sep 2004 05:30:23 -0000 @@ -140,7 +140,7 @@ if (!EG(objects_store).object_buckets[handle].destructor_called) { EG(objects_store).object_buckets[handle].destructor_called = 1; - if (obj->dtor) { + if (EG(exit_status) == SUCCESS && obj->dtor) { /* only call destructor if there was no fatal errors before */ obj->dtor(obj->object, handle TSRMLS_CC); } } --Multipart=_Fri__10_Sep_2004_09_57_25_+0400_V4PlmZw_8wNxFPoa--