From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12606 Path: news.gmane.org!.POSTED!not-for-mail From: Rich Felker Newsgroups: gmane.linux.lib.musl.general Subject: Re: How to test if dlclose is a no-op? Date: Thu, 15 Mar 2018 10:40:15 -0400 Message-ID: <20180315144015.GD1436@brightrain.aerifal.cx> References: Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1521124711 29443 195.159.176.226 (15 Mar 2018 14:38:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2018 14:38:31 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: musl@lists.openwall.com Original-X-From: musl-return-12620-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 15 15:38:27 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1ewU1Q-0007Vf-CS for gllmg-musl@m.gmane.org; Thu, 15 Mar 2018 15:38:24 +0100 Original-Received: (qmail 4095 invoked by uid 550); 15 Mar 2018 14:40:29 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 4070 invoked from network); 15 Mar 2018 14:40:28 -0000 Content-Disposition: inline In-Reply-To: Original-Sender: Rich Felker Xref: news.gmane.org gmane.linux.lib.musl.general:12606 Archived-At: On Thu, Mar 15, 2018 at 08:32:34AM -0500, Thadeus Fleming wrote: > In the spirit of not “assum[ing] a certain implementation has > particular properties rather than testing,” how can one test if > dlclose is a no-op, as it is in musl, without breaking things if it > isn’t? This sounds like an XY problem¹. Do you care about whether you can recover virtual memory space, whether the underlying fs objects remain referenced, whether there's a cycle of dtors and ctors running, or something else? FYI there is no clear answer to the question even on other implementations. glibc only sometimes unloads; there are corner cases and race-type conditions where unloading is impossible for them. You really should not be designing around an assumption/requirement that anything get unloaded. Rich ¹ http://xyproblem.info/