Add deterministic NativeAOT regression smoke test for GC restricted reverse P/Invoke assert path#130459
Draft
MichalStrehovsky with Copilot wants to merge 2 commits into
Draft
Add deterministic NativeAOT regression smoke test for GC restricted reverse P/Invoke assert path#130459MichalStrehovsky with Copilot wants to merge 2 commits into
MichalStrehovsky with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add regression test for NativeAOT runtime assertion failure
Add deterministic NativeAOT regression smoke test for GC restricted reverse P/Invoke assert path
Jul 10, 2026
Contributor
|
Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib |
This was referenced Jul 10, 2026
Open
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds a focused NativeAOT regression test for the GC restricted callout path where background GC can invoke managed
[UnmanagedCallersOnly]callbacks and hitThread::InlineTryFastReversePInvokeassertion behavior prior to the runtime fix. The change is test-only and is intended to reliably drive the failing pre-fix path, not modify product behavior.Test added
src/tests/nativeaot/SmokeTests/GcRestrictedCalloutReversePInvoke/Repro wiring
ComWrappers.RegisterForTrackerSupport(...).MockReferenceTrackerRuntimeso GC restricted tracker callbacks are active (GCStopCollectionpath).Deterministic triggering
GC.Collect(..., blocking:false)).SpinWait+ elapsed bound) instead of unbounded probabilistic loops.Scope/guards
Expectation documented
dotnet/runtime#110683and states expected behavior:Environment limitation observed while validating command
ReleaseNativeAOT targeted test build failed due to missingMicrosoft.DotNet.ILCompiler.SingleEntry.targets;Checkedconfiguration was used for targeted execution.