From owner-freebsd-hackers@FreeBSD.ORG Tue Jan 1 15:44:46 2008 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBD4116A419 for ; Tue, 1 Jan 2008 15:44:46 +0000 (UTC) (envelope-from markus.hoenicka@mhoenicka.de) Received: from rrzmta1.rz.uni-regensburg.de (rrzmta1.rz.uni-regensburg.de [194.94.155.51]) by mx1.freebsd.org (Postfix) with ESMTP id 78C1613C468 for ; Tue, 1 Jan 2008 15:44:46 +0000 (UTC) (envelope-from markus.hoenicka@mhoenicka.de) Received: from rrzmta1.rz.uni-regensburg.de (localhost [127.0.0.1]) by localhost (Postfix) with SMTP id C822E50A1B; Tue, 1 Jan 2008 16:44:49 +0100 (CET) Received: from yeti.mininet (rrzras1-24.rz.uni-regensburg.de [132.199.208.34]) by rrzmta1.rz.uni-regensburg.de (Postfix) with ESMTP id 748EE50974; Tue, 1 Jan 2008 16:44:43 +0100 (CET) X-Mailer: emacs 21.3.1 (via feedmail 8 Q); VM 7.19 under Emacs 21.3.1 From: "Markus Hoenicka" MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18298.23974.148428.962657@yeti.mininet> Date: Tue, 1 Jan 2008 16:35:02 +0100 To: Tim Kientzle 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> X-Mailman-Approved-At: Tue, 01 Jan 2008 16:11:40 +0000 Cc: freebsd-hackers@freebsd.org Subject: Re: dlopen(), atexit() crash on FreeBSD (testcase included) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Jan 2008 15:44:46 -0000 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