Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:12845 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55190 invoked by uid 1010); 15 Sep 2004 20:23:14 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 51904 invoked from network); 15 Sep 2004 20:22:12 -0000 Received: from unknown (HELO smtp.unet.ru) (213.219.244.56) by pb1.pair.com with SMTP; 15 Sep 2004 20:22:12 -0000 Received: from host.phpclub.net by smtp.unet.ru (8.12.9/Unet) with ESMTP id i8FKMBIl079164; Thu, 16 Sep 2004 00:22:11 +0400 (MSD) Received: from armada by host.phpclub.net (8.12.6/Unet) with ESMTP id i8FKM2YL039802; Thu, 16 Sep 2004 00:22:06 +0400 (MSD) Date: Tue, 14 Sep 2004 18:18:29 +0400 To: Stanislav Malyshev Cc: internals@lists.php.net Message-ID: <20040914181829.24869390.tony2001@phpclub.net> In-Reply-To: References: <20040910095725.257bcb8e.tony2001@phpclub.net> X-Mailer: Sylpheed version 0.9.10cvs12 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] [patch] Zend/zend_objects_API.c - bug #29980 (segfault while executing __destruct()) From: tony2001@phpclub.net (Antony Dovgal) On Mon, 13 Sep 2004 14:02:43 +0300 (IDT) Stanislav Malyshev wrote: > AD>>ATM ZE2 calls destructor at the end of the request and no matter > AD>is>there were a fatal error (which should probably stop executing > AD>the>script). In some cases it leads to nasty segfaults (me and > AD>report's>author can reproduce it, but others can't. weird..). > > Well, the cause of the faults is as follows: > If we are in shutdown, and one of the destructors fails with fatal > error, then other destructors for other objects are not called. Thus, > their if they hold some objects, destructors for these objects will > not be called. Later, when the storage is cleaned with > zend_objects_store_free_object_storage(), engine will attempt to call > dtors for objects that didn't have their dtors called before. However, > on that stage engine is already unable to run PHP code (function and > class tables are already cleaned, etc.) - so it crashes. Looks like you're right, but why others can't reproduce this segfault? > What I would propose is to inhibit calling destructors after > shutdown_destructors() was finished. Sounds nice: we should not call destructors after they were already called =) I could propose a simple solution: add a global flag, which will indicate that shutdown_destructors() was called, and do appropriate check in zend_objects_store_del_ref(). Comments/objections? -- Wbr, Antony Dovgal aka tony2001 tony2001@phpclub.net || antony@dovgal.com