From 201b4b33f02dd2930f70635f050600f0b7502243 Mon Sep 17 00:00:00 2001 From: Peter Conrad Date: Mon, 16 Sep 2019 21:02:50 +0200 Subject: [PATCH] Print stacktrace when yielding within an exception handler --- src/thread/thread_d.hpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/thread/thread_d.hpp b/src/thread/thread_d.hpp index 77e8fb7..c81ba1c 100644 --- a/src/thread/thread_d.hpp +++ b/src/thread/thread_d.hpp @@ -1,12 +1,14 @@ #include +#include #include #include #include "context.hpp" #include #include #include + +#include #include -//#include namespace fc { struct sleep_priority_less { @@ -390,7 +392,8 @@ namespace fc { /* NB: At least on Win64, this only catches a yield while in the body of * a catch block; it fails to catch a yield while unwinding the stack, which * is probably just as likely to cause crashes */ - assert(std::current_exception() == std::exception_ptr()); + if( std::current_exception() != std::exception_ptr() ) + print_stacktrace( std::cerr ); check_for_timeouts(); if( !current )