Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
joaodasilva opened this issue Feb 13, 2022 · 2 comments
Open

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

joaodasilva opened this issue Feb 13, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@joaodasilva
Copy link
Contributor

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

@joaodasilva joaodasilva added the bug Something isn't working label Feb 13, 2022
@joaodasilva
Copy link
Contributor Author

This still reproes with debug MSVC builds and using std::exit.

@joaodasilva
Copy link
Contributor Author

The child exits with status 3221225477, which is STATUS_ACCESS_VIOLATION and suggests reading invalid memory at shutdown.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant