package build failing non-deterministically on Windows: race on dual dll copies?
Friday's package build failed: https://github.com/DynamoRIO/dynamorio/runs/1672245697
389
[259/585] Linking C shared library lib64\release\dynamorio.dll
390
Creating library lib64\release\dynamorio.lib and object lib64\release\dynamorio.exp
391
392
LINK : warning LNK4281: undesirable base address 0x71000000 for x64 image; set base address above 4GB for best ASLR optimization
393
737
[493/585] Linking C executable clients\bin64\winsysnums.exe
868
[531/585] Linking CXX executable clients\bin64\opcode_mix_launcher.exe
881
[536/585] Linking CXX executable clients\bin64\drcov2lcov.exe
882
Creating library clients\lib64\release\drcov2lcov.lib and object clients\lib64\release\drcov2lcov.exp
883
884
[537/585] Generating drcov.dox
885
[538/585] Linking CXX executable clients\bin64\drcachesim.exe
886
FAILED: clients/bin64/drcachesim.exe
887
cmd.exe /C "cd . && "C:\Program Files\CMake\bin\cmake.exe" -E vs_link_exe --intdir=clients\drcachesim\CMakeFiles\drcachesim.dir --rc=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x86\rc.exe --mt=C:\PROGRA~2\WI3CF2~1\10\bin\100177~1.0\x86\mt.exe --manifests -- C:\PROGRA~2\MICROS~1\2017\ENTERP~1\VC\Tools\MSVC\1416~1.270\bin\Hostx64\x64\link.exe /nologo clients\drcachesim\CMakeFiles\drcachesim.dir\launcher.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\analyzer.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\analyzer_multi.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\common\named_pipe_win.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\common\options.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\common\trace_entry.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\reader\reader.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\reader\config_reader.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\reader\file_reader.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\reader\ipc_reader.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\simulator\analyzer_interface.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\tracer\instru.cpp.obj clients\drcachesim\CMakeFiles\drcachesim.dir\tracer\instru_online.cpp.obj /out:clients\bin64\drcachesim.exe /implib:clients\lib64\release\drcachesim.lib /pdb:clients\bin64\drcachesim.pdb /version:0.0 /machine:x64 /subsystem:console,5.02 /opt:ref /opt:icf /pdbcompress /debug /subsystem:console /opt:ref /opt:icf /pdbcompress /nodefaultlib:libcmt libcpmt.lib libcmt.lib libvcruntime.lib libucrt.lib clients\lib64\release\drmemtrace_simulator.lib clients\lib64\release\drmemtrace_reuse_distance.lib clients\lib64\release\drmemtrace_histogram.lib clients\lib64\release\drmemtrace_reuse_time.lib clients\lib64\release\drmemtrace_basic_counts.lib clients\lib64\release\drmemtrace_opcode_mix.lib clients\lib64\release\drmemtrace_view.lib clients\lib64\release\drmemtrace_func_view.lib clients\lib64\release\drmemtrace_raw2trace.lib clients\lib64\release\directory_iterator.lib lib64\drdecode.lib lib64\drinjectlib.lib lib64\drconfiglib.lib lib64\drfrontendlib.lib ext\lib64\release\drcovlib_static.lib ext\lib64\release\drutil_static.lib libcpmt.lib libcmt.lib libvcruntime.lib libucrt.lib lib64\drdecode.lib kernel32.lib advapi32.lib imagehlp.lib lib64\drlibc.lib ext\lib64\release\drx_static.lib lib64\ntdll_imports.lib ext\lib64\release\drreg_static.lib ext\lib64\release\drmgr_static.lib ext\lib64\release\drcontainers.lib lib64\release\dynamorio.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cmd.exe /C "cd /D D:\a\dynamorio\dynamorio\build_release-64\clients\drcachesim && "C:\Program Files\CMake\bin\cmake.exe" -E copy D:/a/dynamorio/dynamorio/build_release-64/lib64/drinjectlib.dll D:/a/dynamorio/dynamorio/build_release-64/clients/bin64/drinjectlib.dll && cd /D D:\a\dynamorio\dynamorio\build_release-64\clients\drcachesim && "C:\Program Files\CMake\bin\cmake.exe" -E copy D:/a/dynamorio/dynamorio/build_release-64/lib64/drconfiglib.dll D:/a/dynamorio/dynamorio/build_release-64/clients/bin64/drconfiglib.dll && cd /D D:\a\dynamorio\dynamorio\build_release-64\clients\drcachesim && "C:\Program Files\CMake\bin\cmake.exe" -E copy D:/a/dynamorio/dynamorio/build_release-64/lib64/release/dynamorio.dll D:/a/dynamorio/dynamorio/build_release-64/clients/bin64/dynamorio.dll""
888
Creating library clients\lib64\release\drcachesim.lib and object clients\lib64\release\drcachesim.exp
889
890
Error copying file "D:/a/dynamorio/dynamorio/build_release-64/lib64/release/dynamorio.dll" to "D:/a/dynamorio/dynamorio/build_release-64/clients/bin64/dynamorio.dll".
So clearly dynamorio.dll has been created, and the clients/bin64 directory exists.
A race between drcov2lcov and drcachesim both copying dynamorio.dll into clients/bin64? Maybe "CMake -E copy" checks for existence and has no error if there's a clear ordering and one copy finishes first, but here drcov2lcov and drcachesim are both doing the copy at the same time and the 2nd one's existence check says nothing is there but then the copy fails because the first is currently writing to it with a file lock?