Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Jan 2008 16:35:02 +0100
From:      "Markus Hoenicka" <markus.hoenicka@mhoenicka.de>
To:        Tim Kientzle <kientzle@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: dlopen(), atexit() crash on FreeBSD (testcase included)
Message-ID:  <18298.23974.148428.962657@yeti.mininet>
In-Reply-To: <4779AD03.1060505@freebsd.org>
References:  <18297.6718.750894.937199@yeti.mininet> <20071231142620.39f2fbd2@kan.dnsalias.net> <18297.20596.564077.568365@yeti.mininet> <4779AD03.1060505@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Tim Kientzle writes:
 > I would be curious to see the results of running your
 > sample program (with lots of extra fprint(stderr...)
 > calls, of course) on Linux to see whether it calls the
 > registered exit function at dlclose time or never.
 > 
 > I suspect the answer is "never."  If I'm right, the
 > Firebird folks might be easier to convince (since it
 > means that their atexit() registration isn't really
 > reliable anywhere).
 > 

I've opened a Firebird bug report, so please don't misread me as
"please fix it on the FreeBSD end". But interestingly, I get the
following output of my test program on Linux (note that you have to
link against libdl on Linux as their libc does not contain the dl*
functions):

markus@ocean:~/prog/datest$ ./datest
hello driver
now exiting

So the installed handler is called and runs ok. I'm wondering if this
just so happens to work, or if Linux uses some weird mechanism to keep
the installed routines accessible. But again, there is no need to
investigate this any further, I'm just curious by design.

regards,
Markus

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18298.23974.148428.962657>