Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Feb 2003 15:05:53 -0500
From:      Mikhail Teterin <mi+mx@aldan.algebra.com>
To:        Max Khon <fjoe@iclub.nsu.ru>
Cc:        arch@freebsd.org, Alfred Perlstein <bright@mu.org>, Wes Peters <wes@softweyr.com>, Mario Sergio Fujikawa Ferreira <lioux@freebsd.org>
Subject:   Re: dlclose() vs. atexit()
Message-ID:  <200302041505.53352.mi%2Bmx@aldan.algebra.com>
In-Reply-To: <20030205014229.A62172@iclub.nsu.ru>
References:  <200302030506.h1356Nha011918@repoman.freebsd.org> <200302041046.13767.mi%2Bmx@aldan.algebra.com> <20030205014229.A62172@iclub.nsu.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 04 February 2003 02:42 pm, Max Khon wrote:
= hi, there!
= 
= > Yet another plan would be to have the atexit() call simply increase the
= > ref-count of the library a handler is from, so it will not actually be
= > unloaded by dlclose(). But that will be yet another implementation...
= 
= this will break applications which want to reload some
= of the dlopen'ed modules

I guess, I'm especially slow today. How will it break them? That is
what Solaris appears to be doing, BTW -- calling the exit-handler at
dlclose(), but leaving the library in memory:

	SunOS [...] 5.8 Generic_108528-13 sun4u sparc SUNW,Sun-Fire-280R
	Loading the libraries
	./l0.so loaded as ff3a1458
	./l1.so loaded as ff3a17b8
	Library 0 calling atexit(ff260380)
	Library 1 calling atexit(ff350380)
	Unloading the libraries
	Exit handler ff350380 of library 0 is invoked
	ff3a1458 unloaded
	Exit handler ff260380 of library 1 is invoked
	ff3a17b8 unloaded
	Libraries unloaded. Returning

See, the exit handler for library 1 is called and does not crash, even
though it is defined in the already dlclosed library 0...

	-mi



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200302041505.53352.mi%2Bmx>