D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13426 - crash when using exceptions in a non-d thread (in thread_stackBottom)
Summary: crash when using exceptions in a non-d thread (in thread_stackBottom)
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86_64 Linux
: P3 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-09-05 20:28 UTC by Philippe
Modified: 2024-12-13 18:25 UTC (History)
0 users

See Also:


Attachments
minimal example that crashes (562 bytes, application/x-bzip)
2014-09-05 20:28 UTC, Philippe
Details

Note You need to log in before you can comment on or make changes to this issue.
Description Philippe 2014-09-05 20:28:36 UTC
Created attachment 1418 [details]
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 dlangBugzillaToGithub 2024-12-13 18:25:47 UTC
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