Bug 13426 – crash when using exceptions in a non-d thread (in thread_stackBottom)

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-09-05T20:28:36Z
Last change time
2024-12-13T18:25:47Z
Assigned to
No Owner
Creator
Philippe
Moved to GitHub: dmd#18878 →

Attachments

IDFilenameSummaryContent-TypeSize
1418dcrash.tar.bz2minimal example that crashesapplication/x-bzip562

Comments

Comment #0 by blastrock — 2014-09-05T20:28:36Z
Created attachment 1418 minimal example that crashes Hi, When a thread is created from C++ (or probably any other language) and this thread calls back to a D function which deals with exceptions (even if they are properly caught), the program will crash. Here is the stack: #0 0x000000000041f469 in thread_stackBottom () #1 0x000000000041ee5a in core.runtime.defaultTraceHandler() () #2 0x000000000041ee01 in core.runtime.defaultTraceHandler() () #3 0x000000000041e6a1 in _d_traceContext () #4 0x000000000041bf78 in _d_createTrace () #5 0x0000000000417872 in _d_throwc () #6 0x000000000041746d in test.throwit() () at test.d:15 #7 0x00000000004173fe in callback() () at test.d:6 #8 0x00007ffff7bd956d in std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) (this=0x647708) at /usr/include/c++/4.9/functional:1700 #9 0x00007ffff7bd94b5 in std::_Bind_simple<void (*())()>::operator()() (this=0x647708) at /usr/include/c++/4.9/functional:1688 #10 0x00007ffff7bd9432 in std::thread::_Impl<std::_Bind_simple<void (*())()> >::_M_run() ( this=0x6476f0) at /usr/include/c++/4.9/thread:115 #11 0x00007ffff6eac8a0 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6 #12 0x00007ffff77b30a4 in start_thread (arg=0x7ffff6bdf700) at pthread_create.c:309 #13 0x00007ffff71e7c2d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 I attached a minimal example. Just run build_and_gdb.sh which will compile the c++ library, the d program and start gdb on it.
Comment #1 by robert.schadek — 2024-12-13T18:25:47Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18878 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB