It seems that these errors occur when performing PGO-instrumented runs of multithreaded applications. They can be avoided by compiling (not linking) with the /PogoSafeMode
flag on x64.
I didn't find the MSDN documentation on this flag particularly clear; the correct procedure for performing PGO on multithreaded code is:
- Compile with
cl.exe /PogoSafeMode
- Link with
link.exe /LTCG:PGI
- Execute your multithreaded profiling run(s)
- Re-link with
link.exe /LTCG:PGO