I wanted to try out the new address sanitizer for MSVC, and after enabling it in my project I'm getting an access violation exception which the call stack says originates in __acrt_initialize()
Line 291. Some research show that this happens before calling the main function, and indeed, a breakpoint on the first line of WinMain is not reached before this happens. With the sanitizer disabled, I am not getting any exceptions.
Asked
Active
Viewed 418 times
0

Eyal K.
- 1,042
- 8
- 23
-
1There's a problem in a constructor or initializer of some global variable. Perhaps an instance of [the static initialization order fiasco](https://en.cppreference.com/w/cpp/language/siof), where initialization of one global variable depends on another that's defined in a different translation unit. – Igor Tandetnik Oct 03 '21 at 14:28
-
@IgorTandetnik that could be it, but all of my globals are POD. Any way to narrow it down to find the culprit? – Eyal K. Oct 03 '21 at 15:20
-
Do you use libraries in DLLs that use the same C runtime and share some classes with the app? If so, maybe this https://stackoverflow.com/q/69678689/2945027 – Alex Guteniev Nov 07 '21 at 13:29