From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8357F384B801; Thu, 9 Sep 2021 08:35:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8357F384B801 From: "mail at milianw dot de" To: glibc-bugs@sourceware.org Subject: [Bug dynamic-link/28248] is there a way to LD_PRELOAD library before other dynamic libraries? Date: Thu, 09 Sep 2021 08:35:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: dynamic-link X-Bugzilla-Version: 2.33 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mail at milianw dot de X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: security- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: glibc-bugs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-bugs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Sep 2021 08:35:34 -0000 https://sourceware.org/bugzilla/show_bug.cgi?id=3D28248 --- Comment #4 from Milian Wolff --- Thank you, I'll try out that linker flag and report back. > So this is about destructors? Yes, indeed. As a heap profiler and leak checker, I would like to call `__libc_freeres` to silence leaks, similar to how valgrind does it. And I n= eed do that before any other library gets unloaded, as those could potentially = try to dlclose plugins loaded at runtime (this is what QtCore does). Doing that after `__libc_freeres` would lead to crashes. So here I'm looking for ways = of preventing said crash. > glibc currently does not guarantee that destructors run in the opposite o= rder of constructors Hm that sounds unfortunate. But if you say: "don't guarantee" - does it do = it normally, and there are just some corner cases where it wouldn't happen? As long as it would help with the common case I'm running into (see above), it would help me. Cheers --=20 You are receiving this mail because: You are on the CC list for the bug.=