D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21465 - Static druntime accesses TLS after the thread is dead
Summary: Static druntime accesses TLS after the thread is dead
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: druntime (show other issues)
Version: D2
Hardware: x86_64 Linux
: P1 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-12-09 16:46 UTC by omerfirmak
Modified: 2021-03-30 10:07 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description omerfirmak 2020-12-09 16:46:21 UTC
Similar to the issue fixed here https://github.com/dlang/druntime/pull/1655#issuecomment-279223238 ,static version of the sections_elf_shared.d accesses TLS of a dead thread here https://github.com/dlang/druntime/blob/d97ec4093b108dc2fa95f1fa04b1114e6e0611f8/src/rt/sections_elf_shared.d#L288

This was encountered on https://github.com/dlang/druntime/blob/master/test/thread/src/external_threads.d while porting ldc 1.24.0 to Alpine Linux which uses Musl. https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/14364 But this issue should be affecting other libc implementations as well.
Comment 1 omerfirmak 2020-12-09 17:05:56 UTC
Proposed fix: https://github.com/dlang/druntime/pull/3308