Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:7645 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 43757 invoked by uid 1010); 8 Feb 2004 17:08:58 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 43615 invoked from network); 8 Feb 2004 17:08:56 -0000 Received: from unknown (HELO mail.zend.com) (192.117.235.230) by pb1.pair.com with SMTP; 8 Feb 2004 17:08:56 -0000 Received: (qmail 11984 invoked from network); 8 Feb 2004 17:08:48 -0000 Received: from guardian.zend.office (HELO andi-laptop.zend.com) (10.1.1.4) by mail.zend.com with SMTP; 8 Feb 2004 17:08:48 -0000 Message-ID: <5.1.0.14.2.20040208190811.02aa4998@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Sun, 08 Feb 2004 19:08:47 +0200 To: "Rob Richards" , In-Reply-To: <027501c3ee62$2e21d240$f7dea8c0@cyberware.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Subject: Re: [PHP-DEV] Iterators and new destructors From: andi@zend.com (Andi Gutmans) References: <027501c3ee62$2e21d240$f7dea8c0@cyberware.local> 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