Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7653 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 57809 invoked by uid 1010); 8 Feb 2004 21:29:26 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 57785 invoked from network); 8 Feb 2004 21:29:25 -0000 Received: from unknown (HELO amf.hotels-on-air.de) (217.194.75.126) by pb1.pair.com with SMTP; 8 Feb 2004 21:29:25 -0000 Received: from trillian ([10.10.30.128]) by amf.hotels-on-air.de (8.12.3/8.12.3/SuSE Linux 0.6) with ESMTP id i18LTKOd026561; Sun, 8 Feb 2004 22:29:23 +0100 Date: Sun, 8 Feb 2004 22:27:23 +0100 X-Mailer: The Bat! (v2.00) Educational Reply-To: Marcus Boerger X-Priority: 3 (Normal) Message-ID: <7724172358.20040208222723@marcus-boerger.de> To: Andi Gutmans CC: Rob Richards , internals@lists.php.net In-Reply-To: <5.1.0.14.2.20040208190811.02aa4998@127.0.0.1> References: <027501c3ee62$2e21d240$f7dea8c0@cyberware.local> <5.1.0.14.2.20040208190811.02aa4998@127.0.0.1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavis-milter (http://amavis.org/) Subject: Re: [PHP-DEV] Iterators and new destructors From: helly@php.net (Marcus Boerger) Hello Andi, without looking at the code i guessed iterators needed both, destruction and cleaning. But unfortunatley i fear i cannot look into it until wednesday. So i took a few mins right now and i'd say you should commit Rob's patch which seems correct. regards marcus Sunday, February 8, 2004, 6:08:47 PM, you wrote: > I submitted the patch for checking free_storage != NULL. > Marcus, will have to look into SPL and see if dtor is more suitable than > free_storage. > Andi > At 11:39 AM 2/8/2004 -0500, Rob Richards wrote: >>It appears that the zend iterators need to go back to using the dtor >>callback rather than free storage. >>throwing an unhandled exception in any of the iterator foreach loops in SPL, >>SXE and DOM results in a segfault due to improper cleanup. >> >>To reproduce, put a throw new exception within one of the foreach calls in >>limititerator or array_iterator from the SPL tests. >> >>Registering dtor instead of a free storage callback in zend_iterator_wrap >>seems to let the iterator objects cleanup properly. >>Also in zend_objects_store_del_ref, free_storage is never tested so if an >>object doesn't implement this, it causes a segfault. >> >>Patch attached. >> >>Rob >> >>-- >>PHP Internals - PHP Runtime Development Mailing List >>To unsubscribe, visit: http://www.php.net/unsub.php -- Best regards, Marcus mailto:helly@php.net