Bug 2032647

Summary: glibc: ELF dependency sorting improvements
Product: Red Hat Enterprise Linux 9 Reporter: Florian Weimer <fweimer>
Component: glibcAssignee: Florian Weimer <fweimer>
Status: CLOSED ERRATA QA Contact: Sergey Kolosov <skolosov>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 9.0CC: ashankar, codonell, dj, fweimer, mnewsome, pfrankli, sipoyare
Target Milestone: rcKeywords: Bugfix, Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: glibc-2.34-18.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 15:48:51 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1162810    
Bug Blocks:    

Description Florian Weimer 2021-12-14 21:14:34 UTC
I would like to propose to switch to the new dependency sorting algorithm in glibc 2.35 (with a targeted backport).

Backporting (at least) these commits should fix a long-standing performance issue in dlclose/process termination (bug 1159809, bug 1305145):

commit 15a0c5730d1d5aeb95f50c9ec7470640084feae8
Author: Chung-Lin Tang <cltang>
Date:   Thu Oct 21 21:41:22 2021 +0800

    elf: Fix slow DSO sorting behavior in dynamic loader (BZ #17645)

commit 0884724a95b60452ad483dbe086d237d02ba624d
Author: Florian Weimer <fweimer>
Date:   Tue Dec 14 12:37:44 2021 +0100

    elf: Use new dependency sorting algorithm by default

If we also backport the proposed change to disregard relocation dependencies:

[PATCH 0/2] Predictable ELF destructor ordering
<https://sourceware.org/pipermail/libc-alpha/2021-December/134165.html>

we will fix bug 1133521.

I think it would be safer to make these changes at 9 GA, so that Red Hat Enterprise Linux uses the new algorithm from the start.

Comment 1 Carlos O'Donell 2021-12-15 02:45:37 UTC
(In reply to Florian Weimer from comment #0)
> I think it would be safer to make these changes at 9 GA, so that Red Hat
> Enterprise Linux uses the new algorithm from the start.

As PO I approve of this change for RHEL9 GA.

The change improves conformance for ISO C++.

The order of destructors, particularly since no objects are unmapped until after all destructors run, should be possible to have as exactly the reverse order of constructors (as the change proposes).

This has the benefit that it meets customer expectations and the ordering is not changed by the loader.

The change is not an ABI change, so it could be changed if we determine there are customer requirements with existing binaries from RHEL7 and RHEL8.

The only risk would be that specific workloads fail in this case, but we can evaluate that on a per-workload basis and adjust as required.

None of this changes the existing semantics of STB_GNU_UNIQUE for C++.

This is orthogonal to the new DSO sorting improvement upstream.

Comment 3 Florian Weimer 2022-01-14 14:26:09 UTC
The destructor sorting changes have not yet landed upstream. So I'm going with the constructor sorting changes only.

Comment 9 errata-xmlrpc 2022-05-17 15:48:51 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: glibc), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:3917