-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Crash on Win64 (minimal example included) #1743
Comments
I believe this is a duplicate of #1700. There's a bug in the MS static crt that means global thread local variables will crash if initialised on a thread before the main crt initialisation (which should happen at process startup, but happens later in initialisation). That means when RenderDoc injects a thread to insert its hooks, the thread_local variable causes a crash. As far as I know the only workaround is to use the dynamic CRT. |
Looks like it. Thanks for the info. |
Initialize on demand instead of when the application starts for every thread. This works around a bug in the static debug MSVC runtime (/MTd). At time of writing, Godot is using /MT even in debug builds, which prevents from getting safety checks from the standard library. But when /MTd is used, global scope static thread_local variables holding standard library objects make the runtime crash. See: baldurk/renderdoc#1743 https://developercommunity.visualstudio.com/t/race-condition-on-g-tss-mutex-with-static-crt/672664
Description
This happens when:
Steps to reproduce
Compile the above with:
cl main.cc user32.lib /EHsc /MTd
. Launch it with RenderDoc, and it crashes.Visual Studio gives the following stack trace:
Stack trace of main.exe
RenderDoc's diagnostic log
Environment
The text was updated successfully, but these errors were encountered: