Re: [patch] Zend/zend_objects_API.c - bug #29980 (segfault while executing __destruct())

From: Date: Thu, 16 Sep 2004 18:25:31 +0000
Subject: Re: [patch] Zend/zend_objects_API.c - bug #29980 (segfault while executing __destruct())
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-12883@lists.php.net to get a copy of this message
At 04:31 PM 9/16/2004 +0300, Stanislav Malyshev wrote:
AD>>I could propose a simple solution: add a global flag, which will indicate AD>>that shutdown_destructors() was called, and do appropriate check in AD>>zend_objects_store_del_ref(). AD>>Comments/objections? I personally don't like the idea of having yet another hack flag. Moveover, the del_ref is not the only place one may call destructors. What I'd do is: if one of the dtors bails out, we catch it in call_dtors and then mark all the objects as "already destroyed" - so there's no way any dtor could be called after that from any place. This is a bit slower performance-wise, bnut I'm not sure performance is much of concern in situation where the code has failed in shutdown - I don't know any "fast failure" benchmarks ;) After all, it will be not much longer than the regular shutdown anyway - one pass over the store. The advantage of this approach is that it follows the existing protocol and not insterts another flag (read - branch in any function working along the protocol) which leads to potential breakage.
Yep, that's exactly what I thought. Andi

« previous php.internals (#12883) next »