Hi Paul,
Today I tried building the Xenbus drivers with ‘build.py checked’, but the build fails. If I build without running SDV (Static Driver Verifier), everything is fine. There are some warnings (as shown below) and the projects in the solution
are setup to treat warnings as errors.
What should I do to use the SDV to verify the PV drivers? Is this a known issue and I should just disable SDV?
Thanks for your help,
Christian
C:\xenbits\pvdrivers\xenbus\vs2013\xen>msbuild.exe /m:1 /p:Configuration="Windows 8 Release" /p:Platform="x64" /t:"Build" xen.vcxproj
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.34003]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 2/5/2015 3:34:26 PM.
Project "C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj" on node 1 (Build target(s)).
PrepareForBuild:
Creating directory "..\xen\Windows8Release\x64\".
Creating directory "..\Windows8Release\x64\".
Creating directory "..\xen\Windows8Release\x64\xen.tlog\".
InitializeBuildStatus:
Creating "..\xen\Windows8Release\x64\xen.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
_MASM:
Assembling ..\..\src\xen\amd64\hypercall_thunk.asm...
cmd.exe /C "C:\Users\christian.refvik\AppData\Local\Temp\tmp95adf46008a64d249a0db183cc77a012.cmd"
ml64.exe /c /nologo /Zi /Fo"..\xen\Windows8Release\x64\hypercall_thunk.obj" /W3 /errorReport:prompt /Ta..\..\src\xen\amd64\hypercall_thunk.asm
_MASM:
Skipping target "_MASM" because all output files are up-to-date with respect to the input files.
CustomBuildStep:
Skipping target "CustomBuildStep" because all output files are up-to-date with respect to the input files.
ClCompile:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\CL.exe /c /I"C:\Program Files (x86)\Windows Kits\8.1\\include\km" /I..\xen\Windows8Release\x64\ /Zi /nologo /Wall /WX /MP /Ox /Os /Oy- /D CODE_ANALYSIS /D __x86_64__
/D "__MODULE__=\"XEN\"" /D POOL_NX_OPTIN=1 /D _WIN64 /D _AMD64_ /D AMD64 /D _WIN32_WINNT=0x0602 /D WINVER=0x0602 /D WINNT=1 /D NTDDI_VERSION=0x06020000 /D _AMD64_ /GF /Gm- /Zp8 /GS /Gy /fp:precise
registry.c
driver.c
event_channel.c
grant_table.c
hvm.c
xen_version.c
hypercall.c
memory.c
sched.c
log.c
bug_check.c
module.c
process.c
acpi.c
system.c
ResourceCompile:
C:\Program Files (x86)\Windows Kits\8.1\bin\x86\rc.exe /D _WIN64 /D _AMD64_=1 /D AMD64 /D _WIN32_WINNT=0x0602 /D WINVER=0x0602 /D WINNT=1 /D NTDDI_VERSION=0x06020000 /l"0x0409" /I"C:\Program Files (x86)\Windows Kits\8.1\Include\UM" /I..\xen\Windows8Release\x64\
/nologo /fo"..\xen\Windows8Release\x64\xen.res" ..\..\src\xen\xen.rc
Link:
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64\link.exe /ERRORREPORT:QUEUE /OUT:"..\Windows8Release\x64\xen.sys" /VERSION:"6.3" /INCREMENTAL:NO /NOLOGO /WX /SECTION:"INIT,d" "C:\Program Files (x86)\Windows Kits\8.1\lib\win8\KM\x64/libcntpr.lib"
"C:\Program Files (x86)\Windows Kits\8.1\lib\win8\KM\x64/aux_klib.lib" "C:\Program Files (x86)\Windows Kits\8.1\lib\win8\KM\x64\BufferOverflowFastFailK.lib" "C:\Pro
..\xen\Windows8Release\x64\xen.res
..\xen\Windows8Release\x64\registry.obj
..\xen\Windows8Release\x64\driver.obj
..\xen\Windows8Release\x64\event_channel.obj
..\xen\Windows8Release\x64\grant_table.obj
..\xen\Windows8Release\x64\hvm.obj
..\xen\Windows8Release\x64\xen_version.obj
..\xen\Windows8Release\x64\hypercall.obj
..\xen\Windows8Release\x64\memory.obj
..\xen\Windows8Release\x64\sched.obj
..\xen\Windows8Release\x64\log.obj
..\xen\Windows8Release\x64\bug_check.obj
..\xen\Windows8Release\x64\module.obj
..\xen\Windows8Release\x64\process.obj
..\xen\Windows8Release\x64\acpi.obj
..\xen\Windows8Release\x64\system.obj
Creating library ..\Windows8Release\x64\xen.lib and object ..\Windows8Release\x64\xen.exp
xen.vcxproj -> C:\xenbits\pvdrivers\xenbus\vs2013\xen\..\Windows8Release\x64\xen.sys
DriverTestSign:
Sign Inputs: C:\xenbits\pvdrivers\xenbus\vs2013\xen\..\Windows8Release\x64\xen.sys
C:\Program Files (x86)\Windows Kits\8.1\bin\x86\signtool.exe sign /ph /sha1 "337D411D5F99F4EED21E8E88BF82CDC8AF3F64F5"
Done Adding Additional Store
Successfully signed: C:\xenbits\pvdrivers\xenbus\vs2013\xen\..\Windows8Release\x64\xen.sys
Certificate used for signing: issued to = XENBUS (TEST) and thumbprint = 337D411D5F99F4EED21E8E88BF82CDC8AF3F64F5
Exported Certificate: ..\Windows8Release\x64\xen.cer
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(178): warning C6102: Using 'Length' from failed function call at line '175'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(368): warning C6102: Using 'Size' from failed function call at line '364'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(469): warning C6102: Using 'Size' from failed function call at line '465'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(602): warning C6102: Using 'Size' from failed function call at line '598'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(827): warning C6102: Using 'Size' from failed function call at line '823'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(899): warning C6102: Using 'Size' from failed function call at line '894'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
FinalizeBuildStatus:
Deleting file "..\xen\Windows8Release\x64\xen.tlog\unsuccessfulbuild".
Touching "..\xen\Windows8Release\x64\xen.tlog\xen.lastbuildstate".
Done Building Project "C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj" (Build target(s)).
Build succeeded.
"C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj" (Build target) (1) ->
(RunNativeCodeAnalysis target) ->
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(178): warning C6102: Using 'Length' from failed function call at line '175'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(368): warning C6102: Using 'Size' from failed function call at line '364'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(469): warning C6102: Using 'Size' from failed function call at line '465'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(602): warning C6102: Using 'Size' from failed function call at line '598'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(827): warning C6102: Using 'Size' from failed function call at line '823'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
c:\xenbits\pvdrivers\xenbus\src\common\registry.c(899): warning C6102: Using 'Size' from failed function call at line '894'. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
6 Warning(s)
0 Error(s)
Time Elapsed 00:00:05.74
C:\xenbits\pvdrivers\xenbus\vs2013\xen>if errorlevel 1 goto error
C:\xenbits\pvdrivers\xenbus\vs2013\xen>exit 0
['vs2013', 'xen', 'sdv']
['vs2013', 'xen', 'sdv.temp']
['vs2013', 'xen', 'staticdv.job']
['vs2013', 'xen', 'refine.sdv']
['vs2013', 'xen', 'sdv-map.h']
vs2013\xen
['C:\\Users\\christian.refvik\\Development\\xenbits\\pvdrivers\\xenbus\\msbuild.bat']
C:\xenbits\pvdrivers\xenbus\vs2013\xen>call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
C:\xenbits\pvdrivers\xenbus\vs2013\xen>msbuild.exe /m:1 /p:Configuration="Windows 8 Release" /p:Platform="x64" /t:"sdv" /p:Inputs="/scan" xen.vcxproj
Microsoft (R) Build Engine version 12.0.21005.1
[Microsoft .NET Framework, version 4.0.30319.34003]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 2/5/2015 3:34:32 PM.
Project "C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj" on node 1 (sdv target(s)).
sdv:
staticdv.exe /scan
---------------------------------------------------------------------
Microsoft (R) Windows (R) Static Driver Verifier Version 4.0.500.1
Copyright (C) Microsoft Corporation. All rights reserved.
---------------------------------------------------------------------
SDV is building for <Windows 8 Release|x64>
SDV is building for <Windows 8 Release|x64>
The call to "Build" failed.
EXEC : Build warning : ..\..\src\common\registry.c(224): error C2220: warning treated as error - no 'object' file generated [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj] [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
EXEC : Build warning : ..\..\src\common\registry.c(224): error C2220: warning treated as error - no 'object' file generated [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj] [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
SDV exit code: 5
SDV encountered errors when scanning the driver. Please ensure roletypes are present and/or consult SDV documentation.
C:\Program Files (x86)\Windows Kits\8.1\build\windowsdriver.Sdv.targets(65,9): error MSB3075: The command "staticdv.exe /scan" exited with code 5. Please verify that you have sufficient rights to run this command. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
Done Building Project "C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj" (sdv target(s)) -- FAILED.
Build FAILED.
"C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj" (sdv target) (1) ->
(sdv target) ->
EXEC : Build warning : ..\..\src\common\registry.c(224): error C2220: warning treated as error - no 'object' file generated [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj] [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
EXEC : Build warning : ..\..\src\common\registry.c(224): error C2220: warning treated as error - no 'object' file generated [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj] [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
"C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj" (sdv target) (1) ->
(sdv target) ->
C:\Program Files (x86)\Windows Kits\8.1\build\windowsdriver.Sdv.targets(65,9): error MSB3075: The command "staticdv.exe /scan" exited with code 5. Please verify that you have sufficient rights to run this command. [C:\xenbits\pvdrivers\xenbus\vs2013\xen\xen.vcxproj]
2 Warning(s)
1 Error(s)
Time Elapsed 00:00:06.51
C:\xenbits\pvdrivers\xenbus\vs2013\xen>if errorlevel 1 goto error
C:\xenbits\pvdrivers\xenbus\vs2013\xen>exit 1
Traceback (most recent call last):
File "C:\xenbits\pvdrivers\xenbus\build.py", line 370, in <module>
run_sdv('xen', driver, vs)
File "C:\xenbits\pvdrivers\xenbus\build.py", line 204, in run_sdv
'/p:Inputs="/scan"', os.path.join(vs, name))
File "C:\xenbits\pvdrivers\xenbus\build.py", line 124, in msbuild
raise msbuild_failure(configuration)
__main__.msbuild_failure: 'Windows 8 Release'
C:\xenbits\pvdrivers\xenbus>