diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2019-05-28 12:09:42 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2019-05-28 16:03:05 +0300 |
commit | af635957efca0dfcd79e7c297a69db36e4971e98 (patch) | |
tree | 51549d5d26e998f3b533a5dfa273a8227aa1690b /build2/scheduler.cxx | |
parent | 9996a730b686399d385bf2696d3b9cd681b0fcec (diff) |
Print backtrace to stderr when terminating due to unhandled exception
Diffstat (limited to 'build2/scheduler.cxx')
-rw-r--r-- | build2/scheduler.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/build2/scheduler.cxx b/build2/scheduler.cxx index 790f2f6..ad3a640 100644 --- a/build2/scheduler.cxx +++ b/build2/scheduler.cxx @@ -588,6 +588,12 @@ namespace build2 // inherit the main thread's stack size (since the first helper is always // created by the main thread). // + // Note also the interaction with our backtrace functionality: in order to + // get the complete stack trace we let unhandled exceptions escape the + // thread function expecting the runtime to still call std::terminate. In + // particular, having a noexcept function anywhere on the exception's path + // causes the stack trace to be truncated, at least on Linux. + // #if defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__) #ifndef BUILD2_DEFAULT_STACK_SIZE |