Summary: | deadlock in dlopen when ctor calls dlopen in another thread | ||
---|---|---|---|
Product: | glibc | Reporter: | Szabolcs Nagy <nszabolcs> |
Component: | dynamic-link | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED DUPLICATE | ||
Severity: | normal | CC: | carlos, fweimer |
Priority: | P2 | Flags: | fweimer:
security-
|
Version: | 2.22 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: |
Description
Szabolcs Nagy
2016-01-12 10:48:31 UTC
This is another case of dlopen being synchronously reentered by another context of execution, but in this case there is no easy fix (like there was in the case of an interposed malloc that calls dlopen itself). The constructor is essentially a foreign function being called while holding the load lock, and when you recursively enter dlopen again from another thread, you get a deadlock. Siddhesh and I talked about this at one point last year and the consensus among us was that we can't fix this without rewriting the dynamic load routines to use atomic operations and remove all instances of the load lock. Doing so would simplify a lot of the other problems we have (we would also remove lazy TLS allocation to fix the AS-safe issue calling malloc when accessing TLS variables for the first time in signal handlers). |