This repository has been archived by the owner on Oct 12, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sections_elf_shared: Do not access TLS of dead thread in finiTLSRanges()
finiTLSRanges() is called from the destructor of core.Thread. At this point, the OS thread has already ceased to exist, so what was formerly a pointer to _loadedDSOs is no longer valid. In other words, `tdsos.reset()` was a use-after-free bug. It is unclear why the issue didn't surface on Linux/FreeBSD yet; for example, glibc might not actually re-use the TLS address range after a thread exits. On OS X, however, this did quite frequently trigger a crash when running the Phobos unit tests, since `tdsos` would have already been overwritten with unrelated contents.
- Loading branch information