MSB6003: The specified task executable "CL.exe" could not be run. Access is denied
Hi,
I see some occasional deadlocks when starting multiple cmake processes for checking symbols simultaneously.
I have a lot of stuff to check (include files, functions, symbols etc.). I've written a dispatcher which generates CMakeLists.txt files and starts cmake N processses. N - number of cores.
And 1-2 cmake processes (out of my 8 logical cores and therefore cmake processes) hangs. Sometimes they work fine, sometimes not. One user reported that he has 100% repeatable deadlocks on his system. On my system these deadlocks could unlock in 5-10 minutes while on the other systems could not.
I decided to catch the issue on my system. I've built cmake-3.7.0 rel with deb info build. Once I was hit by deadlock I've attached to cmake process.
So, cmake is waiting for msbuild.exe
to finish. I see main+4 threads. Background threads are hunting for stdout data and spinning somewhere in Source\kwsys\ProcessWin32.c - kwsysProcessPipeThreadReadPipe()
. Main thread is waiting in G:\dev\CMake\Source\cmSystemTools.cxx:614 - RunSingleCommand()
and line 614
- while ((pipe = cmsysProcess_WaitForData(cp, &data, &length, CM_NULLPTR)) >
.
I've gathered msbuild.exe
output vars.
Contents:
Change Dir: C:/Users/egor/AppData/Local/Temp/cppan/vars/UIow8Z2e/6/CMakeFiles/CMakeTmp
Run Build Command:"C:/Program Files (x86)/MSBuild/14.0/bin/MSBuild.exe" "cmTC_c91b8.vcxproj" "/p:Configuration=Debug" "/p:VisualStudioVersion=14.0"
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 28.11.2016 16:28:08.
Project "C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\cmTC_c91b8.vcxproj" on node 1 (default targets).
PrepareForBuild:
Creating directory "cmTC_c91b8.dir\Debug\".
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\cmTC_c91b8.vcxproj]
Creating directory "C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\Debug\".
Creating directory "cmTC_c91b8.dir\Debug\cmTC_c91b8.tlog\".
InitializeBuildStatus:
Creating "cmTC_c91b8.dir\Debug\cmTC_c91b8.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe /c /Zi /W3 /WX- /Od /Ob0 /Oy- /D WIN32 /D _WINDOWS /D _DEBUG /D "CMAKE_INTDIR=\"Debug\"" /D _MBCS /Gm- /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /Fo"cmTC_c91b8.dir\Debug\\" /Fd"cmTC_c91b8.dir\Debug\vc140.pdb" /Gd /TC /analyze- /errorReport:queue C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CheckTypeSize\HAVE_GID_T.c
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6003: The specified task executable "CL.exe" could not be run. Access is denied [C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\cmTC_c91b8.vcxproj]
Done Building Project "C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\cmTC_c91b8.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\cmTC_c91b8.vcxproj" (default target) (1) ->
(PrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(400,5): warning MSB8029: The Intermediate directory or Output directory cannot reside under the Temporary directory as it could lead to issues with incremental build. [C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\cmTC_c91b8.vcxproj]
"C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\cmTC_c91b8.vcxproj" (default target) (1) ->
(ClCompile target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6003: The specified task executable "CL.exe" could not be run. Access is denied [C:\Users\egor\AppData\Local\Temp\cppan\vars\UIow8Z2e\6\CMakeFiles\CMakeTmp\cmTC_c91b8.vcxproj]
1 Warning(s)
1 Error(s)
Time Elapsed 00:02:00.71
Output says C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(356,5): error MSB6003: The specified task executable "CL.exe" could not be run. Access is denied
.
So, what does it mean? Who is responsible for deadlocks? msbuild? cmake? (maybe issues in reading from pipes)
Maybe you know what this error means. I googled it but nothing concrete.
Access is denied
probably meansERROR_ACCESS_DENIED
returned from GetLastError()
but I wonder what causes this error.