Boost logo

Boost Users :

Subject: [Boost-users] [stacktrace] Getting a stacktrace from unhandled exception in windows
From: Don (dm413-boost_at_[hidden])
Date: 2017-09-10 23:27:47


I am trying use boost stacktrace to get a stack dump when my program encounters an unhandled exception under windows. I have installed a signal handler as described in the stacktrace documentation, and it gets called. However, the resulting stack trace is after everything has been unwound.

For example, when I force a failure by dereferenceing a null pointer many levels down in my function hierarchy, the stack trace shows:

 Â 0# boost::stacktrace::detail::this_thread_frames::safe_dump_to_impl<char const *> at f:\home\tools\boost\boost\stacktrace\safe_dump_to.hpp:68
 Â 1# boost::stacktrace::safe_dump_to at f:\home\tools\boost\boost\stacktrace\safe_dump_to.hpp:120
 Â 2# my_signal_handler at f:\home\test\main.cpp:233
 Â 3# 0x5171407B
 Â 4# my_signal_handler at f:\home\test\main.cpp:235
 Â 5# 0x51713883
 Â 6# __tmainCRTStartup at f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c:603
 Â 7# WinMainCRTStartup at f:\dd\vctools\crt_bld\self_x86\crt\src\crtexe.c:403
 Â 8# BaseThreadInitThunk in kernel32
 Â 9# RtlInitializeExceptionChain in ntdll
10# RtlInitializeExceptionChain in ntdll

This is not particularly helpful, of course -- I want to know the call stack at the point of the failure. Is there any way to get that? What am I missing?

Thanks,

Don


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net