Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:19147 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55545 invoked by uid 1010); 24 Sep 2005 11:01:10 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 55530 invoked from network); 24 Sep 2005 11:01:10 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Sep 2005 11:01:10 -0000 X-Host-Fingerprint: 72.14.204.195 qproxy.gmail.com Linux 2.4/2.6 Received: from ([72.14.204.195:54270] helo=qproxy.gmail.com) by pb1.pair.com (ecelerity 2.0 beta r(6323M)) with SMTP id 5B/5D-24510-6F135334 for ; Sat, 24 Sep 2005 07:01:10 -0400 Received: by qproxy.gmail.com with SMTP id c12so232166qbc for ; Sat, 24 Sep 2005 04:01:06 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=YAFBef4hD1MG73hMGKhYUjbchH4uvDBMKEeVRcLsg9X2PjBtNFDEASfmVPMJuaEF+wKgQGLo2PYbBdIJ0380FGfEz2ils6Gr/5kAt1Bp4UjSqWbsaTfMknRdcXk9PjAZG1bmrjR6Ng43h5Q72yWQyQtCqE+cKUrzwNx/G4YXZaY= Received: by 10.64.251.2 with SMTP id y2mr305058qbh; Sat, 24 Sep 2005 04:01:06 -0700 (PDT) Received: by 10.64.251.3 with HTTP; Sat, 24 Sep 2005 04:01:06 -0700 (PDT) Message-ID: Date: Sat, 24 Sep 2005 07:01:06 -0400 Reply-To: Dan Scott To: internals In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <4e89b426050922192768c6764e@mail.gmail.com> Subject: Re: [PHP-DEV] shutdown order changed again? broken dl()'d modules, again From: denials@gmail.com (Dan Scott) On 9/23/05, Derick Rethans wrote: > On Thu, 22 Sep 2005, Wez Furlong wrote: > > > Sounds like we're unloading the modules before calling the dtors again. > > The code says this: > /* 1. Call all possible shutdown functions registered with register_s= hutdown_function() */ > /* 2. Call all possible __destruct() functions */ > zend_try { > zend_call_destructors(TSRMLS_C); > } zend_end_try(); > > /* 3. Flush all output buffers */ > /* 4. Send the set HTTP headers (note: This must be done AFTER > /* 5. Call all extensions RSHUTDOWN functions */ > if (PG(modules_activated)) { > zend_deactivate_modules(TSRMLS_C); > php_free_shutdown_functions(TSRMLS_C); > } > > So your statement seems incorrect, not sure what is breaking though... I don't think the bug I'm seeing is related to any change in the PHP shutdown order -- on RHEL 4 and Gentoo the ibm_db2 extension segfaults on shutdown when compiled as a shared extension and run in CLI mode, no matter whether I'm using PHP 5.0.3, 5.0.4, 5.0.5, or HEAD. Compiling it statically, however, prevents the shutdown segfault from occurring. This problem did not happen in the past on these distros, so I suspect that it's actually a recent update to glibc/libstdc++/ld that's causing the segfault strace shows libstdc++ getting mmap'ed before libgcc_s, and then getting munmap'ed before libgcc_s. (libdb2 is compiled from C++, thus the dependency on libstdc++.) Based on past experiences with FreeBSD 4.6, Andrei and Rasmus suggested that the problem may be a defective linker, which seems entirely plausible. I'll try compiling PDO + PDO_ODBC (ibm-db2 flavour) as a shared extension to see if it suffers the same fate. Dan