Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
trylek opened this issue Dec 13, 2020 · 3 comments
Labels
area-Infrastructure-coreclr help wanted [up-for-grabs] Good issue for external contributors
Milestone

Comments

@trylek
Copy link
Member

trylek commented Dec 13, 2020

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

@ViktorHofer
Copy link
Member

cc @akoeplinger and @marek-safar regarding the linker ask.

@akoeplinger
Copy link
Member

@ViktorHofer this is about the native C++ linker, not the managed linker :)

@ViktorHofer
Copy link
Member

Haha 😂 thanks for clarifying

@trylek trylek added the help wanted [up-for-grabs] Good issue for external contributors label Mar 2, 2021
@agocke agocke modified the milestones: 6.0.0, Future Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Infrastructure-coreclr help wanted [up-for-grabs] Good issue for external contributors
Projects
Status: No status
Development

No branches or pull requests

4 participants