boostorg / stacktrace

C++ library for storing and printing backtraces.
https://boost.org/libs/stacktrace
422 stars 69 forks source link

[win32] crash with 0xC000000D in dll after exit() was called #148

Closed mika-fischer closed 7 months ago

mika-fischer commented 9 months ago

I have a nodejs addon (basically a dll), and want to print a stacktrace under some circumstances using to_string(stacktrace()). If this happens after nodejs calls exit(), I get a crash. It does not make a difference whether I use BOOST_STACKTRACE_USE_WINDBG_CACHED or not. What helps is to format a stacktrace before exit() is called.

Maybe exit makes it impossible to load new dlls?

2023-11-27_14h51_24 2023-11-27_14h51_14 2023-11-27_14h51_18
apolukhin commented 9 months ago

Try calling stacktrace before the exit for first time. Probably after such initialization the stacktrace would work after exit

mika-fischer commented 9 months ago

Yes, that works, that's what I meant by

What helps is to format a stacktrace before exit() is called.

Still, it's a bit unfortunate that it just crashes otherwise...

apolukhin commented 7 months ago

I'm afraid that this is a Windows runtime limitation. I could do some initialization on program start, however this would make many other developers unhappy

Closing as 'wont fix'