Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:6917 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 42437 invoked by uid 1010); 9 Jan 2004 05:11:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 42183 invoked from network); 9 Jan 2004 05:11:46 -0000 Received: from unknown (HELO asuka.nerv) (24.112.18.98) by pb1.pair.com with SMTP; 9 Jan 2004 05:11:46 -0000 Received: (qmail 26432 invoked from network); 9 Jan 2004 05:11:45 -0000 Received: from rei.nerv (HELO dummy.com) (rei@192.168.1.1) by asuka.nerv with SMTP; 9 Jan 2004 05:11:45 -0000 Reply-To: ilia@prohost.org To: internals@lists.php.net Date: Fri, 9 Jan 2004 00:11:44 -0500 User-Agent: KMail/1.5.94 Organization: Prohost.org MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-ID: <200401090011.44840.ilia@prohost.org> Subject: ZE2, dl() and objects From: ilia@prohost.org (Ilia Alshanetsky) It seems there is a problem in either the PHP's shutdown sequence in php_request_shutdown() or destrutor order in ZE2. The problem is quite simple, the module loaded via dl() (when libdl is used) is unloaded before the objects it creates are destroyed. Consequently when Zend Engine tries to destroy the object the handler pointer is pointing to a random memory address. This can only be replicate if libdl is used because the module unloading is conditional upon HAVE_LIBDL inside module_destructor(). To demonstrate the problem compile pecl/date as a shared module and run -r ' dl("date.so"); $a = new date(); ' Ilia