I'm unable to run code analysis on files that include <atomic>. When this occurs, the code starts to builds (100% CPU usage) but then hangs with 0% CPU usage indefinitely. There are no warning or errors, the code just doesn't finish.
I'm currently on Visual Studio: 15.9.33. I've had this problem for about 1.5 years now. Reinstalling the OS has not helped.
Here is a simple code snippit based on code from xatomic.h that when copy pasted into any cpp file, causes the same behavior,
#include <intrin0.h>
void code_analysis_hangs()
{
auto foo = _InterlockedCompareExchange8((char *)0, 0, 0);
}
void code_analasis_success()
{
_InterlockedCompareExchange8((char *)0, 0, 0);
}
char code_analysis_success2()
{
return _InterlockedCompareExchange8((char *)0, 0, 0);
}
This same pattern appears on all _InterlockedCompareExhange functions as well as _InterlockedExchange from intrin.h.
:::EDIT::: The same behavior was seen by someone else: https://developercommunity.visualstudio.com/t/c-code-analysis-never-finishes-under-1592/394996
I've also isolated the issue to localespc.dll. There are 2 plugins that get run when analysis is turned on /analysis /analysis:plugin...EspXEngine.dll /analysis:plugin...localespc.dll. In my vcxproj, by manually adding the analysis options for CL.exe without the localespc.dll, code analysis seems to work and not stall while still appearing to report code analysis.