[Issue 18815] New: thread_attachThis crash
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue May 1 22:00:22 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18815
Issue ID: 18815
Summary: thread_attachThis crash
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: turkeyman at gmail.com
C++ main()
call rt_init
create thread (using C++11 std::thread)
from thread_entry_func:
call into D code (via extern(C) function)
call thread_attachThis to register the C++ thread with druntime
*CRASH*
It appears to invoke a GC collect in thread_attachThis(), which calls
thread_suspendAll(), which calls Thread.getThis(), which returns null (because
thread_attachThis hasn't finished), which is passed to suspend(), where it is
de-referenced and segfault.
Crashes every time. Every call to thread_attachThis() without fail.
--
More information about the Digitalmars-d-bugs
mailing list