Skip to content

Fix crash at shutdown on Windows debug builds with MSVC #86

Description

@joaodasilva

The program in attachment crashes after 10 to 100 runs on debug builds with MSVC on Windows.

This seems to come from a destructor running at shutdown, possibly reaching for memory from an object that has already been destroyed. The issue only reproes on early exits via std::exit, which is often used in child processes (and in tests).

Window.js doesn't have any destructors at shutdown, and this is likely coming from one of the libraries used. It's quite tricky to pin this down.

The temporary fix at in commit f56ae2f uses std::quick_exit instead, to bypass the atexit callbacks. This isn't great; this bug is to change that back to std::exit and fix the shutdown issue.

https://gist.github.com/joaodasilva/f5fe471c7b27a2606689c6aeeb7398ed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions