Subject [firebird-support] dlopen(), atexit() on FreeBSD
Author Markus Hoenicka
Markus Hoenicka writes:
> Hi,
>
> I bumped into a platform-specific problem when using the libfbembed.so
> client library in a dlopen()ed module on FreeBSD. libdbi
> (http://libdbi.sourceforge.net) is a database abstraction layer which
> dlopen()s available database drivers at runtime to provide
> connectivity to various database engines. This design works without
> problems on a variety of platforms and with a variety of database
> client libraries, but causes a segfault with Firebird on FreeBSD:
>

I've received the following reply from the freebsd-hackers list which
I asked in parallel:

> As designed. atexit should not be used by shared objects that do not
> expect themselves to live until actual exit() happens. ELF provides
> proper _init/_fini sections to support shared object
> initialization/destruction.
>

Is there a chance the Firebird client libraries can be modified
accordingly to avoid the calls to atexit()?

regards,
Markus

--
Markus Hoenicka
markus.hoenicka@...
(Spam-protected email: replace the quadrupeds with "mhoenicka")
http://www.mhoenicka.de