Bug 21465 – Static druntime accesses TLS after the thread is dead

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-12-09T16:46:21Z
Last change time
2021-03-30T10:07:42Z
Assigned to
No Owner
Creator
omerfirmak

Comments

Comment #0 by omerfirmak — 2020-12-09T16:46:21Z
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 by omerfirmak — 2020-12-09T17:05:56Z