From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/12608 Path: news.gmane.org!.POSTED!not-for-mail From: Thadeus Fleming Newsgroups: gmane.linux.lib.musl.general Subject: Re: How to test if dlclose is a no-op? Date: Thu, 15 Mar 2018 10:24:05 -0500 Message-ID: References: <20180315144015.GD1436@brightrain.aerifal.cx> 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: quoted-printable X-Trace: blaine.gmane.org 1521127336 25366 195.159.176.226 (15 Mar 2018 15:22:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 15 Mar 2018 15:22:16 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-12622-gllmg-musl=m.gmane.org@lists.openwall.com Thu Mar 15 16:22:12 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 1ewUho-0006Un-86 for gllmg-musl@m.gmane.org; Thu, 15 Mar 2018 16:22:12 +0100 Original-Received: (qmail 22096 invoked by uid 550); 15 Mar 2018 15:24:17 -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 22077 invoked from network); 15 Mar 2018 15:24:17 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=BRAVFKmVS9xDLqYQspLN+nOvh2kQAXCvjunZLbXD2UY=; b=Ku2mYG+T6kI3IWdWm4m7tIb0I36rRcELUv8E6JksDxo2+hNOvTVLP9++iRh1ltl5lY mY3cRVhlG8l0Dg3fAm0qn1dXRQlleLOEtmuXISCsoL39nkPRvy88penfJHfxfPJ1qCx2 FdBbok/a1OQY0yTFF9Opt/UuoAqCeR49IQo8sv7/s0beI5c08LZbIWWJji7JNT+/x8Mo dnt2VNDFVHWXeafKXxyeswmteSxwHX9J8yDGomtYKkhLgT8LzixffDKWApYSMNOMxhXs X1ORh/U5YaPt9/9nh0zhzQdYmkDAsepJ94DxOSsGKz4Lgx+RrXpeKhkytrLfPnuwWSQf TDvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=BRAVFKmVS9xDLqYQspLN+nOvh2kQAXCvjunZLbXD2UY=; b=pUhhOpVfXOM+odNrh1V4VXbKxvauuvkUw05CWAejQkWdx4y+vHBVeLHvZOu/+Hp5jP pFSVgXmXN6XVsCnO+Bp2v02UwXw/1EIVRH9OyCJV4Gdwv1LK9j7FhIF+OBpK7wPa41LL EHHeGm7xeI2VdZys/KukATPJhj7do4or/z1bf8KhBZdhkkpHzQLHO6rEIQbSFWlDRmA4 ijKTR8xx8/8bPFBltwT/t06kwvJeaoa6thNiWM9Za2vXZzVguoJqAp7b3DppyGlEgCoH 2MHP27bs/rxGzgB5feVloSZWfugzQCiSBZ+usPagiez+H33wFq/wHG1WZ5qG4I0hyyqN lF0g== X-Gm-Message-State: AElRT7ETLZpu/QfrtQv7JE6iVCvzfm6GuXkZYXjOEtJkFoTjRTVlm8Gd d32dlow/74F1GZZVFOKSI2Fsnz0J0e8SmLOmXPZu7w== X-Google-Smtp-Source: AG47ELvIDIHMNZ1VEXDhzdAmx2Zb0YdP8KmdRYqYnaJMNCcC8Wox+lI39ZvlCw8uHNQrCL5RhkR915LNCsM4eb6v+2c= X-Received: by 10.80.174.156 with SMTP id e28mr9285768edd.285.1521127445568; Thu, 15 Mar 2018 08:24:05 -0700 (PDT) In-Reply-To: <20180315144015.GD1436@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:12608 Archived-At: I'm working on improving a system that makes some bad assumptions about dynamic unloading. While I'm not fond of dynamic unloading, I think it might be valuable to be able to distinguish between "this C library doesn't support unloading at all" and "if the planets are all aligned, unloading might work." Testing if dlclose is a no-op would allow me to make that distinction. On Thu, Mar 15, 2018 at 9:40 AM, Rich Felker wrote: > On Thu, Mar 15, 2018 at 08:32:34AM -0500, Thadeus Fleming wrote: >> In the spirit of not =E2=80=9Cassum[ing] a certain implementation has >> particular properties rather than testing,=E2=80=9D how can one test if >> dlclose is a no-op, as it is in musl, without breaking things if it >> isn=E2=80=99t? > > This sounds like an XY problem=C2=B9. 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 > > > > =C2=B9 http://xyproblem.info/