Skip to content

Sharing violation reading pgd file during concurrent local coreclr builds (windows x86 release) #46018

@trylek

Description

@trylek

Initial cost estimate: 2 days
Initial contacts: @trylek, @jkoritzinsky, @davidwrighton

OS: Windows
Architecture: x86
Configuration: Release
Repro steps (non-deterministic): build clr+libs+libs.tests -a x86 -c Release in two runtime repo clones

    D:\git\runtime\artifacts\obj\coreclr\windows.x86.Release\vm\wks\cee_wks_obj.dir\Release\ceemain.obj
  LINK : fatal error LNK1266: error reading instrumentation file 'C:\Users\trylek\.nuget\packages\optimization.windows_nt-x86.pgo.coreclr\99.99.99-master-20200806.6\data\coreclr.pgd'; Sharing violation [D:\git\runtime\artifacts\obj\coreclr\windows.x86.Release\dlls\mscoree\coreclr\coreclr.vcxproj]
    Finished generating code
    mscordaccore.vcxproj -> D:\git\runtime\artifacts\obj\coreclr\windows.x86.Release\dlls\mscordac\Release\mscordaccore.dll

  Build FAILED.

  LINK : fatal error LNK1266: error reading instrumentation file 'C:\Users\trylek\.nuget\packages\optimization.windows_nt-x86.pgo.coreclr\99.99.99-master-20200806.6\data\coreclr.pgd'; Sharing violation [D:\git\runtime\artifacts\obj\coreclr\windows.x86.Release\dlls\mscoree\coreclr\coreclr.vcxproj]
      0 Warning(s)
      1 Error(s)

Likely the linker opens the PGD file without the sharing flag so that multiple parallel coreclr builds step on each other's toes. This is happening pretty frequently and degrades local developer inner loop experience. While it seems clearly a linker bug (there's no reason for it to request exclusive / write access to the pgd file), it remains to be seen whether asking for a linker fix would be actionable so we may want to consider a workaround like copying the file to a repo location prior to linking even though it's somewhat unfortunate as the file has 36 MB so that it will probably incur a few seconds' perf penalty.

/cc @dotnet/runtime-infrastructure

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions