dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.08k stars 1.17k forks source link

D3DCompiler_47_cor3.dll fails to load in RC1 tests #9670

Open mmitche opened 2 months ago

mmitche commented 2 months ago

In rc1, the following error shows up in some tests:

image

Upon further investigation, between builds https://dev.azure.com/dnceng/internal/_build/results?buildId=2516540 and https://dev.azure.com/dnceng/internal/_build/results?buildId=2517162 of WPF, a change occurred on the build machine that moved the d3d compiler located at C:\Program Files (x86)\Windows Kits\10\Redist\D3D\<arch>\ to a newer version. WPF redists this binary as part of the windows desktop shared framework layout. I don't know whether the bug manifests across all releases, but the d3d compiler redisted with the windows desktop shared framework is the same across all releases.

Older version without issue:

image

Newer version that causes issue:

image

My local copy matches the old version, but I did manage to get the new version to install by adding the Win11 SDK 10.0.26100.0 component in VS. @dotnet/dnceng's rollout schedule shows an update started on 8/14 (https://dev.azure.com/dnceng/internal/_git/dotnet-helix-machines/pullrequest/41664?_a=files&path=/definitions/shared/windows.yaml), but that new SDK version is not in our images. So maybe it came in via some other path. My hunch is some patch for the windows SDK

@Kuldeep-MS for more details on the failure.

Failure Details

All WPF application will encounter this error. Since wpfgfx depends on D3DCompiler_47_cor3.dll, if D3DCompiler_47_cor3.dll fails to load, wpfgfx will also fail to load, leading to the application's crash.

singhashish-wpf commented 2 months ago

@mmitche Thanks for the details. I checked that the dll headers, layout and size are all different for the D3DCompiler_47_cor3.dll This is indeed being picked from the C:\Program Files (x86)\Windows Kits\10\Redist\D3D\<arch>\ I did the same experiment of updating my local VS Workload for Win11 SDK and found that the same issue started popping up with the same header/layout and size. This appears to be something related to infra and there seems 2 solutions in my understanding

  1. WPF pins D3DCompiler_47_cor3.dll and ships this for RC1 with some flag - This would require a re-spin.
  2. The infra pools/workloads get updated - This will also require re-spin

The linker version for the previous (14.30) and new (14.38) dlls are different.

I don't see a way where we can fix this without a re-spin as WPF is redistributing the dll from the windows sdk and that is corrupt or updated due to which this problem is occurring. Even a simple plain wpf app wouldn't run and would crash with the same error. Do we have a short circuit to roll out updates to the pools with the updated/reverted windows sdk workload?