From af635957efca0dfcd79e7c297a69db36e4971e98 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 28 May 2019 12:09:42 +0300 Subject: Print backtrace to stderr when terminating due to unhandled exception --- build2/scheduler.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'build2/scheduler.cxx') 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 -- cgit v1.1