Bug 21910 – Thread local variables hang the program in -betterC

Status
RESOLVED
Resolution
DUPLICATE
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2021-05-09T23:28:27Z
Last change time
2023-01-15T07:46:23Z
Keywords
betterC
Assigned to
No Owner
Creator
Blatnik
See also
https://issues.dlang.org/show_bug.cgi?id=20737

Comments

Comment #0 by blatblatnik — 2021-05-09T23:28:27Z
In 64bit windows builds, reading/writing thread local variables hangs the program. Forum post about this: https://forum.dlang.org/post/[email protected] Steps to reproduce: - Compiler: dmd 2.096.1 - Platform: Windows 10 64-bit ``` // test.d int a; // thread local extern(C) void main() { printf("before... "); a = 42; // The program hangs here. printf("after"); } ``` ``` $ dmd -betterC test.d; ./test.exe before... after $ dmd -betterC -m64 test.d; ./test.exe before... [program hangs for 3 seconds and exits without printing anything else] ```
Comment #1 by bugzilla — 2023-01-15T07:46:23Z
*** This issue has been marked as a duplicate of issue 20737 ***