Commit Graph

2 Commits

Author SHA1 Message Date
Claude fe4a2cf7d8
fix(libc): run atexit handlers in one order with __cxa_atexit destructors
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ha6Tsy62AFUyp9a5Mf7vjA
2026-10-11 21:05:51 +00:00
Morten Holm 20e8bb09ba fix(libc): run guest exit handlers before the host exit handlers
LibcExit called std::exit, which ran the static destructors of the libraries
before the guest exit handlers. A guest handler that freed memory then locked
a destroyed std::mutex, which throws, and a noexcept guest destructor ended in
std::terminate. The guest handlers now run first, while the library objects
are alive.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 17:53:56 +02:00