Bug 126111
Summary: | pthread_key_create destructor function, and pthread_join don't work during shared library destructors | ||||||
---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Noam Lampert <noaml> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED ERRATA | QA Contact: | Brian Brock <bbrock> | ||||
Severity: | high | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 3.0 | CC: | drepper, roland, yuvalk | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i686 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | 2.3.2-95.24 | Doc Type: | Bug Fix | ||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2004-09-10 19:53:20 UTC | Type: | --- | ||||
Regression: | --- | Mount Type: | --- | ||||
Documentation: | --- | CRM: | |||||
Verified Versions: | Category: | --- | |||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
Cloudforms Team: | --- | Target Upstream Version: | |||||
Embargoed: | |||||||
Attachments: |
|
Description
Noam Lampert
2004-06-16 07:02:17 UTC
Created attachment 101183 [details]
source of reproducer sample
I forgot to mention that this is a regression. In RH EL 3.0 update 1 the sample works (the bug does not occur) In RH EL 3.0 update 2 this bug is easily reproduced. I wonder how this could work in U1. The problem is: 1) shared library destructors are executed with the dl_load_lock held to ensure no new shared libraries are loaded during running of the destructors. This is in the initial thread 2) when a thread is to be cancelled, it uses the unwinder in libgcc_s to unwind through the frames, run any pthread cleanups and class destructors on the way up 3) the unwinder in libgcc_s uses dl_iterate_phdr interface to query all currently loaded shared libraries (this is executed in the context of the child thread) 4) dl_iterate_phdr acquires the dl_load_lock, to make sure no new shared library is loaded and especially that no shared library is unloaded while executing this function. But, dl_load_lock, although it is a recursive lock, is already held by the initial thread, so the child thread gets stuck here until the initial thread releases it after it is done with its constructors I think it worked in U1 because the regression was introduced by the patch glibc-dladdr-locking.patch of 2004-02-20. Removing this patch fixes the problem. I don't suppose this is the way you want to proceed though. This should be fixed in U3. https://rhn.redhat.com/errata/RHBA-2004-384.html |