GNU bug report logs - #38368
gcc/ dlclose() documentation feedback

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: kris <cq.personal@HIDDEN>; merged with #38364; dated Mon, 25 Nov 2019 21:33:39 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 38368 <at> debbugs.gnu.org:


Received: (at 38368) by debbugs.gnu.org; 26 Nov 2019 01:27:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 25 20:27:37 2019
Received: from localhost ([127.0.0.1]:50030 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iZPdh-0001cO-BP
	for submit <at> debbugs.gnu.org; Mon, 25 Nov 2019 20:27:37 -0500
Received: from quimby.gnus.org ([95.216.78.240]:58080)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>)
 id 1iZPde-0001bz-T1; Mon, 25 Nov 2019 20:27:35 -0500
Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1iZPdW-0008By-3l; Tue, 26 Nov 2019 02:27:28 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: kris <cq.personal@HIDDEN>
Subject: Re: bug#38368: gcc/ dlclose() documentation feedback
References: <CACTzTFAPK2hpEyQpA6vhgRhcKMarD=cOOkwQHyMcpOvDb1kFPw@HIDDEN>
Date: Tue, 26 Nov 2019 02:27:25 +0100
In-Reply-To: <CACTzTFAPK2hpEyQpA6vhgRhcKMarD=cOOkwQHyMcpOvDb1kFPw@HIDDEN>
 (kris's message of "Mon, 25 Nov 2019 02:58:42 +0100")
Message-ID: <87tv6rig02.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview: kris <cq.personal@HIDDEN> writes: > I think there is some
 ambiguity in the man page for dlclose(). This bug report landed in the Emacs
 bug tracker -- perhaps because of the debbugs.gnu.org outage yesterday? 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 URIBL_BLOCKED          ADMINISTRATOR NOTICE: The query to URIBL was
 blocked.  See
 http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block
 for more information. [URIs: ingebrigtsen.no]
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 38368
Cc: 38364 <at> debbugs.gnu.org, 38368 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

kris <cq.personal@HIDDEN> writes:

> I think there is some ambiguity in the man page for dlclose().

This bug report landed in the Emacs bug tracker -- perhaps because of
the debbugs.gnu.org outage yesterday?

What package was this bug report meant for?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#38368; Package emacs. Full text available.
Merged 38364 38368. Request was from Glenn Morris <rgm@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 25 Nov 2019 12:58:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Nov 25 07:58:09 2019
Received: from localhost ([127.0.0.1]:47858 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1iZDwP-0005Xt-0w
	for submit <at> debbugs.gnu.org; Mon, 25 Nov 2019 07:58:09 -0500
Received: from lists.gnu.org ([209.51.188.17]:49370)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <cq.personal@HIDDEN>) id 1iZDqU-0005JQ-4w
 for submit <at> debbugs.gnu.org; Mon, 25 Nov 2019 07:52:02 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:43131)
 by lists.gnu.org with esmtp (Exim 4.90_1)
 (envelope-from <cq.personal@HIDDEN>) id 1iZ3eH-0006mB-8s
 for bug-gnu-emacs@HIDDEN; Sun, 24 Nov 2019 20:58:46 -0500
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM
 autolearn=disabled version=3.3.2
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <cq.personal@HIDDEN>) id 1iZ3eG-0005ab-8F
 for bug-gnu-emacs@HIDDEN; Sun, 24 Nov 2019 20:58:45 -0500
Received: from mail-qk1-x734.google.com ([2607:f8b0:4864:20::734]:39895)
 by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.71) (envelope-from <cq.personal@HIDDEN>)
 id 1iZ3eG-0005aU-4w
 for bug-gnu-emacs@HIDDEN; Sun, 24 Nov 2019 20:58:44 -0500
Received: by mail-qk1-x734.google.com with SMTP id z65so6575350qka.6
 for <bug-gnu-emacs@HIDDEN>; Sun, 24 Nov 2019 17:58:44 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:from:date:message-id:subject:to;
 bh=sSZ63YYvHlNx/YNFAttr7I2OdmqG+JV9s9n7O2sTk3Q=;
 b=uGcHV/mUlfSjjih7zvfNX6rgsJdClLZpJeUsQhqbq9kt7JvLPmMCFif17oEiUHr59N
 CsKADOa2rlNhZ1XbT7vz2JAoFiBRHeFIoFmIgHFMHghWrXaXNhHeSWNG4bgVSJ4wnwZ3
 OEdZ2WYbYwKp/AfiqIi/TdBfNc/gLuLoXeYxByBBk5wfM9SEiTIMe+MxMtq0djJKi1Qh
 RzWvBr6TdN1kqC09OZTxPgva99t8FV9MnCaunLy6lBwHyUQZjCPgIV93UbH4DTgCbggq
 Uuav9ixPOSTs/U/XjGYE2o29QkDawkZf4HRTTQeqRDwnOBPfBPPZtz9rlJVy50vWwOU/
 ZAOA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
 bh=sSZ63YYvHlNx/YNFAttr7I2OdmqG+JV9s9n7O2sTk3Q=;
 b=Uo0co6tV4DGeylzdXc05fePWfDahFKFa3wcZcgfkEwTH+dlnAlfS36ahYEVfsLikTF
 O5Kh8kwAgCGbPPWWj8B/74FJZT33+Ndsc4E739xkhYNoU9v40wGCEBnFmERbELt6vuFt
 OmAHU5obRpBV1pPqEefwL3NVTIVv0vmmR5wr3xP906MAWjfqLeCREP62v2Ta4WpqbcP3
 WAlD8EMo+znKcsEZJXsaK2UrDCNKZ8IcfxUqeB6ybhxZkM5lyUhQoHJKmU3fyCL1giR2
 W7jLCzqKENaGb1RSYpcjQtoknF1VOWhSFLyaKw7Brkvua+888bxC37ajIvqYZHHrd/t4
 e7sg==
X-Gm-Message-State: APjAAAVGDzSaA8rUtlW2DLRa+q+iouPdCDnEmL/oHDLtNCpuBd7TMXZp
 CbxhZjw1mwIUZeDxc7SFObgrRtHBgZmuQdKvPcfICw==
X-Google-Smtp-Source: APXvYqyColgM5aaRwk3iIVCxLa4Q1/jWUHehnogqs/GmI/KzlzAhsbttSULF+d0fVOuhhjIdJLlP4AR5hztqDQ0LUpM=
X-Received: by 2002:a05:620a:3dd:: with SMTP id
 r29mr24714882qkm.370.1574647123320; 
 Sun, 24 Nov 2019 17:58:43 -0800 (PST)
MIME-Version: 1.0
Received: by 2002:a0c:e306:0:0:0:0:0 with HTTP; Sun, 24 Nov 2019 17:58:42
 -0800 (PST)
From: kris <cq.personal@HIDDEN>
Date: Mon, 25 Nov 2019 02:58:42 +0100
Message-ID: <CACTzTFAPK2hpEyQpA6vhgRhcKMarD=cOOkwQHyMcpOvDb1kFPw@HIDDEN>
Subject: gcc/ dlclose() documentation feedback
To: bug-gnu-emacs@HIDDEN
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
 recognized.
X-Received-From: 2607:f8b0:4864:20::734
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

hello

I think there is some ambiguity in the man page for dlclose().

***********
A  successful return from dlclose() does not guarantee that the
symbols associated with handle are removed from the caller's address
space.  In addition to references  resulting  from  explicit  dlopen()
 calls, a shared object may have been implicitly loaded (and reference
counted) because of dependencies in other shared objects.  Only when
all references have been released can the shared object be removed
from the address space.
********

that strikes me as undermining the docs for RTLD_NOLOAD in the same page which
say that residency CAN be tested.
i do the following to ensure the object is unloaded:
void *handle = dlopen(path,RTLD_NOW | RTLD_NOLOAD);
if(handle){
  return(dlclose(handle) || dlclose(handle) );
}
... it appears to take 2 calls to achieve the unload which I presume
means the refcount got incremented by this dlopen() despite the
RTLD_NOLOAD.
then I test again this way and the 2nd dlclose() fails and confirms
the object is unloaded.
or so I thought.
this worked until I came to recursively load a chain of objects (not
automatically)
and then tried reloading the 1st in the chain.
despite doing the above closing sequence on the chain in reverse order
and finally
on the head of the chain, before doing another dlopen() with a new
version of the disk file,
I found that extracting the data from the address returned from a
dlsym() yielded old data. I have to conclude that the object unload
does NOT happen and that the above dlopen(RTLD_NOLOAD)/dlclose()  test
is erroneous (at least in this layered arrangement).

so getting back to the original ambiguity claim, the passage mentions
removing symbols in the first instance then switches to 'references
being released' the next.  what are 'references' (symbols?) and how
does one determine anything about them or rather enough to 'release'
them so as to circumvent the lack of a guarantee from dlclose() ?
I have scoured the available docs and can find no more on how to
ascertain what prevents unloading or how such can be addressed.

I hope you agree there is at least a lack of clarity.
thanks for reading.




Acknowledgement sent to kris <cq.personal@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#38368; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 26 Nov 2019 01:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.