[cDAC] Fix GetLocalVariableCount to return E_FAIL for missing local signatures#126115
Merged
max-charlamb merged 1 commit intodotnet:mainfrom Mar 25, 2026
Merged
Conversation
Contributor
|
Tagging subscribers to this area: @steveisok, @tommcdon, @dotnet/dotnet-diag |
Contributor
There was a problem hiding this comment.
Pull request overview
Aligns cDAC ClrDataFrame behavior with the native DAC to avoid Debug.Assert parity failures when analyzing older runtime dumps (e.g., 10.0.5), particularly around locals/argument signature handling.
Changes:
GetNumArguments: relax DEBUG parity validation to allow cDAC success when native DAC can fail due toMetaSigpointer-traversal differences.GetLocalVariableCount: returnE_FAIL(via exception->HRESULT) when no local signature is available, matching native DAC behavior.
…gnatures The native DAC's GetLocalSig returns E_FAIL when a method has no local signature (dynamic methods, IL stubs, methods with no declared locals). The cDAC was returning S_OK with count 0 instead. This mismatch caused Debug.Assert validation failures when running against older runtimes where the cDAC succeeds but the legacy DAC returns E_FAIL. Now GetLocalVariableCount throws Marshal.GetExceptionForHR(E_FAIL) when GetLocalSignatureReader returns null, matching the native DAC behavior. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
109eed5 to
f4a66e4
Compare
hoyosjs
approved these changes
Mar 25, 2026
Member
Author
|
/ba-g cDAC only change |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
GetLocalVariableCount — return E_FAIL for missing local signatures
The native DAC's
GetLocalSigreturnsE_FAILwhen a method has no local signature (dynamic methods, IL stubs, methods with no declared locals). The cDAC was returningS_OKwith count 0 instead. This mismatch caused validation asserts to fire.Now
GetLocalVariableCountthrowsMarshal.GetExceptionForHR(E_FAIL)whenGetLocalSignatureReaderreturns null, matching the native DAC behavior exactly.Testing
GetNumLocalVariablesreturnsE_FAILfor methods without locals (DAC parity)