Re: [PATCH] make dl() DTRT under safe mode
| From: | Rasmus Lerdorf | Date: | Sun, 17 Aug 2003 17:28:55 +0000 |
| Subject: | Re: [PATCH] make dl() DTRT under safe mode | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-4057@lists.php.net to get a copy of this message | ||
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