-
Notifications
You must be signed in to change notification settings - Fork 5.1k
[cDAC] Ensure cDAC is used in test runs #117100
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
base: main
Are you sure you want to change the base?
Conversation
Tagging subscribers to this area: @steveisok, @dotnet/dotnet-diag |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request ensures that the cDAC is properly used in test runs by installing the cDAC DLL into the sharedFramework directory and by updating error handling to fail if the cDAC cannot be created.
- Update the installation destination in the mscordaccore_universal.csproj to install into sharedFramework when using coreclr.
- Add missing PlatformManifestFileEntry items for cDAC DLLs in Directory.Build.props.
- Update daccess.cpp to return an error (E_FAIL) if creating the cDAC interface fails.
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
src/native/managed/cdac/mscordaccore_universal/mscordaccore_universal.csproj | Adjusts the installation destination to sharedFramework. |
src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props | Adds manifest entries for the cDAC libraries. |
src/coreclr/debug/daccess/daccess.cpp | Introduces an early failure when the cDAC interface creation returns nullptr. |
Comments suppressed due to low confidence (2)
src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props:118
- [nitpick] If cDAC usage is conditional, consider adding a Condition attribute to these manifest entries to ensure they are only included when necessary.
<PlatformManifestFileEntry Include="mscordaccore_universal.dll" IsNative="true" />
src/coreclr/debug/daccess/daccess.cpp:7050
- [nitpick] Consider using a more descriptive error code or adding logging to indicate that cDAC interface creation failed, which may help with debugging in case of issues.
if (cdacInterface == nullptr)
@@ -27,8 +27,7 @@ | |||
</ItemGroup> | |||
<ItemGroup> | |||
<InstallRuntimeComponentDestination Include="." /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Ensure that moving the installation destination to sharedFramework is well documented to clarify its relation to SOS expectations and to avoid any future confusion.
<InstallRuntimeComponentDestination Include="." /> | |
<InstallRuntimeComponentDestination Include="." /> | |
<!-- The 'sharedFramework' destination is used for runtime components when the RuntimeFlavor is 'coreclr'. | |
This aligns with SOS expectations, ensuring that runtime components are correctly installed and accessible | |
within the shared framework. Future changes to this destination should consider its impact on SOS and runtime behavior. --> |
Copilot uses AI. Check for mistakes.
Explains why tests started failing https://dev.azure.com/dnceng-public/public/_build/results?buildId=1080586&view=ms.vss-test-web.build-test-results-tab 🙂 Should we add linux and osx legs too in runtime-diagnostics pipeline in case there are similar surprises? |
Yes, I looked into these issues and have addressed them. I will probably move them to a different PR before merging. We are working on including other platforms legs. This requires some refactoring of the diagnostic repo pipelines that do not currently run on helix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -7045,6 +7045,12 @@ CLRDataCreateInstance(REFIID iid, | |||
// Release the AddRef from the QI. | |||
pClrDataAccess->Release(); | |||
} | |||
|
|||
if (cdacInterface == nullptr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@max-charlamb Just curious, the comment on this method mentions it’s a legacy entrypoint. What’s the modern or recommended alternative for cDAC? And what would it take to switch over to it?
While validating #117088, I found that the cDAC was not actually being invoked in the test runs. I'm not sure when this broke, but it appears that
mscordaccore_universal.dll
was being installed in the wrong location. It seems that SOS is looking in the sharedFramework directory, so I included the cDAC dll there as well.The cDAC entrypoint through the brittle DAC (
DOTNET_ENABLE_CDAC=1
) fails back to the DAC silently if the cDAC is not found. To prevent this from happening in the future, I also modified this behavior to fail if the cDAC is requested but cannot be found.Now that the CI run is testing the cDAC properly, it found two issues.
AMD64Unwinder
had an issue where it wasn't sign-extending a value that should be sign-extended.CLRDataTarget
implementations.