Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:4057 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50121 invoked from network); 17 Aug 2003 17:29:02 -0000 Received: from unknown (HELO www.lerdorf.com) (66.93.78.119) by pb1.pair.com with SMTP; 17 Aug 2003 17:29:02 -0000 Received: from phpics.com (rasmus@phpics.com [10.0.1.254]) by www.lerdorf.com (8.12.9/8.12.9/Debian-5) with ESMTP id h7HHStdP004968; Sun, 17 Aug 2003 10:28:55 -0700 Date: Sun, 17 Aug 2003 10:28:55 -0700 (PDT) X-X-Sender: rasmus@www To: Steve Langasek cc: internals@lists.php.net, Derick Rethans , Adam Conrad In-Reply-To: <20030817170352.GA13013@quetzlcoatl.dodds.net> Message-ID: References: <20030817040523.GM13013@quetzlcoatl.dodds.net> <20030817154601.GX13013@quetzlcoatl.dodds.net> <20030817170352.GA13013@quetzlcoatl.dodds.net> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: Re: [PHP-DEV] [PATCH] make dl() DTRT under safe mode From: rasmus@lerdorf.com (Rasmus Lerdorf) On Sun, 17 Aug 2003, Steve Langasek wrote: > > One thing we should probably do is not dlclose() any shared extensions on > > shutdown. I am not sure if your list of bugs included any reports of > > crashes on shutdown, but if you ever come across one of those it is likely > > that removing the dlclose() will fix it. > > I don't recall ever seeing such a bug report. At least in the case of > library symbol conflicts, leaving the shared extension open after the > end of a request would have exactly the opposite effect, though. I meant on server shutdown, not request shutdown. There are a couple of problems in this area. The most obvious affects C++ extensions that use any sort of function-scoped static objects. If you are using an older version of gcc/glibc that doesn't support per-shared-library atexit stacks or if you have compiled your extension without --cxa-atexit (or whatever that option is called) then at shutdown we unload the shared extension but the destructor for the function-scoped static object is sitting on the process atexit stack referring to an address in the now unloaded extension code. -Rasmus