From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/11645 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Multiple bugs in dlopen & dependency tracking Date: Tue, 4 Jul 2017 18:05:10 +0200 Message-ID: <20170704160509.GE2032@port70.net> References: <20170704145328.GA15186@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: blaine.gmane.org 1499184331 5915 195.159.176.226 (4 Jul 2017 16:05:31 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 4 Jul 2017 16:05:31 +0000 (UTC) User-Agent: Mutt/1.6.0 (2016-04-01) To: musl@lists.openwall.com Original-X-From: musl-return-11658-gllmg-musl=m.gmane.org@lists.openwall.com Tue Jul 04 18:05:25 2017 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 1dSQKF-0000zy-FM for gllmg-musl@m.gmane.org; Tue, 04 Jul 2017 18:05:19 +0200 Original-Received: (qmail 9982 invoked by uid 550); 4 Jul 2017 16:05:23 -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 9964 invoked from network); 4 Jul 2017 16:05:22 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <20170704145328.GA15186@brightrain.aerifal.cx> Xref: news.gmane.org gmane.linux.lib.musl.general:11645 Archived-At: * Rich Felker [2017-07-04 10:53:28 -0400]: > Commit 4ff234f6cba96403b5de6d29d48a59fd73252040 introduced a > regression whereby dlopen RTLD_GLOBAL of a library that was previously > loaded RTLD_LOCAL no longer promotes the library to the global > namespace as intended. This is easy to fix, but there are other > related bugs I've found in the process, and I want to document them > here. Some may be trickier to fix. They relate to the ->deps list for > a dso, which is supposed to contain a dependency-order list of dsos > that dlsym will search when called on the dso handle. These are also > connected to the stalled attempt to do dependency-order execution of > constructors. maybe adding debugging to the dynamic linker would help finding these issues earlier (e.g. if LD_DEBUG is set then print some trace to stderr in whatever format about what the dynamic linker is doing) since using a debugger on the dynamic linker is often non-trivial.