-
Notifications
You must be signed in to change notification settings - Fork 5.4k
[cDAC] Fix GetMethodTableName empty type name mismatch #127405
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -143,7 +143,7 @@ extends: | |||||
| artifactName: 'TestResults_cDAC_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)' | ||||||
| displayName: 'Publish Test Results and SOS Logs' | ||||||
| continueOnError: true | ||||||
| condition: failed() | ||||||
| condition: always() | ||||||
| - template: /eng/pipelines/common/platform-matrix.yml | ||||||
| parameters: | ||||||
| jobTemplate: /eng/pipelines/diagnostics/runtime-diag-job.yml | ||||||
|
|
@@ -197,7 +197,7 @@ extends: | |||||
| artifactName: 'TestResults_cDAC_no_fallback_$(osGroup)$(osSubgroup)_$(archType)_$(_BuildConfig)_Attempt$(System.JobAttempt)' | ||||||
| displayName: 'Publish Test Results and SOS Logs' | ||||||
| continueOnError: true | ||||||
| condition: failed() | ||||||
| condition: always() | ||||||
|
||||||
| condition: always() | |
| condition: succeededOrFailed() |
Copilot
AI
Apr 24, 2026
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.
Same as earlier: consider using succeededOrFailed() (or exclude canceled) instead of always() so this publish step doesn’t run on canceled jobs and create noisy failures.
| condition: always() | |
| condition: succeededOrFailed() |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,6 +1,7 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // Licensed to the .NET Foundation under one or more agreements. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // The .NET Foundation licenses this file to you under the MIT license. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using System; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using System.Diagnostics; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using System.IO; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| using System.Runtime.CompilerServices; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -52,5 +53,35 @@ internal static void ValidateHResult( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Debug.Assert(match, $"HResult mismatch - cDAC: 0x{unchecked((uint)cdacHr):X8}, DAC: 0x{unchecked((uint)dacHr):X8} ({Path.GetFileName(filePath)}:{lineNumber})"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [Conditional("DEBUG")] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| internal static unsafe void ValidateOutputStringBuffer( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| char* cdacBuffer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uint* cdacNeeded, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| char[] dacBuffer, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uint dacNeeded, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uint count, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [CallerFilePath] string? filePath = null, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| [CallerLineNumber] int lineNumber = 0) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string location = $"{Path.GetFileName(filePath)}:{lineNumber}"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (cdacNeeded is not null && *cdacNeeded != dacNeeded) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| int cdacLen = (int)Math.Min(*cdacNeeded, count); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string cdacStr = cdacBuffer is not null && cdacLen > 0 ? new string(cdacBuffer, 0, cdacLen - 1) : "<null>"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string dacStr = dacNeeded > 0 ? new string(dacBuffer, 0, (int)dacNeeded - 1) : "<empty>"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Trace.TraceWarning($"Output buffer pNeeded mismatch ({location}) - cDAC: {*cdacNeeded} (\"{cdacStr}\"), DAC: {dacNeeded} (\"{dacStr}\")"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| else if (cdacBuffer is not null && dacNeeded > 0 && count >= dacNeeded) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var cdacSpan = new ReadOnlySpan<char>(cdacBuffer, (int)dacNeeded - 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| var dacSpan = new ReadOnlySpan<char>(dacBuffer, 0, (int)dacNeeded - 1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!cdacSpan.SequenceEqual(dacSpan)) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Trace.TraceWarning($"Output buffer content mismatch ({location}) - cDAC: \"{new string(cdacBuffer, 0, (int)dacNeeded - 1)}\", DAC: \"{new string(dacBuffer, 0, (int)dacNeeded - 1)}\""); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+72
to
+82
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| string cdacStr = cdacBuffer is not null && cdacLen > 0 ? new string(cdacBuffer, 0, cdacLen - 1) : "<null>"; | |
| string dacStr = dacNeeded > 0 ? new string(dacBuffer, 0, (int)dacNeeded - 1) : "<empty>"; | |
| Trace.TraceWarning($"Output buffer pNeeded mismatch ({location}) - cDAC: {*cdacNeeded} (\"{cdacStr}\"), DAC: {dacNeeded} (\"{dacStr}\")"); | |
| } | |
| else if (cdacBuffer is not null && dacNeeded > 0 && count >= dacNeeded) | |
| { | |
| var cdacSpan = new ReadOnlySpan<char>(cdacBuffer, (int)dacNeeded - 1); | |
| var dacSpan = new ReadOnlySpan<char>(dacBuffer, 0, (int)dacNeeded - 1); | |
| if (!cdacSpan.SequenceEqual(dacSpan)) | |
| { | |
| Trace.TraceWarning($"Output buffer content mismatch ({location}) - cDAC: \"{new string(cdacBuffer, 0, (int)dacNeeded - 1)}\", DAC: \"{new string(dacBuffer, 0, (int)dacNeeded - 1)}\""); | |
| int dacLen = (int)Math.Min(dacNeeded, Math.Min((uint)dacBuffer.Length, count)); | |
| string cdacStr = cdacBuffer is not null && cdacLen > 0 ? new string(cdacBuffer, 0, cdacLen - 1) : "<null>"; | |
| string dacStr = dacLen > 0 ? new string(dacBuffer, 0, dacLen - 1) : "<empty>"; | |
| Trace.TraceWarning($"Output buffer pNeeded mismatch ({location}) - cDAC: {*cdacNeeded} (\"{cdacStr}\"), DAC: {dacNeeded} (\"{dacStr}\")"); | |
| } | |
| else if (cdacBuffer is not null && dacNeeded > 0 && count >= dacNeeded) | |
| { | |
| int compareLen = (int)Math.Min(dacNeeded, Math.Min((uint)dacBuffer.Length, count)); | |
| if (compareLen > 0) | |
| { | |
| var cdacSpan = new ReadOnlySpan<char>(cdacBuffer, compareLen - 1); | |
| var dacSpan = new ReadOnlySpan<char>(dacBuffer, 0, compareLen - 1); | |
| if (!cdacSpan.SequenceEqual(dacSpan)) | |
| { | |
| Trace.TraceWarning($"Output buffer content mismatch ({location}) - cDAC: \"{new string(cdacBuffer, 0, compareLen - 1)}\", DAC: \"{new string(dacBuffer, 0, compareLen - 1)}\""); | |
| } |
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.
Using condition: always() will also run this artifact publish step on canceled jobs, which often produces noisy "path not found" failures (even with continueOnError) and extra pipeline work. If the goal is to publish on both pass and fail runs, condition: succeededOrFailed() is typically a better fit (or an always() condition additionally excluding Agent.JobStatus == 'Canceled').