Uh oh!
There was an error while loading. Please reload this page.
Restore stress guards on process-isolated IL tests - #131769
Merged
Merged
Conversation
Fixesdotnet#131447 PR dotnet#126108 replaced the `<JitOptimizationSensitive>` and `<GCStressIncompatible>` MSBuild properties with `[SkipOnCoreClr(...)]` attributes on test entry points. That works for C# tests and for in-process IL tests, but silently drops the guard for IL tests that also set `<RequiresProcessIsolation>`: - C#, any isolation: `GenerateStandaloneSimpleTestRunner` compiles the skip check into `__GeneratedMainWrapper.Main`, so the attribute is honored. - IL, in-process: the merged runner reads the attribute from metadata via `ExternallyReferencedTestMethodsVisitor` and emits the skip, so it is honored. - IL + process isolation: the merged runner emits an `OutOfProcessTest` whose body is just `RunOutOfProcessTest(...)` on the generated run script, and `ReferenceXUnitWrapperGenerator` is gated on `'$(Language)' == 'C#'`, so an IL assembly with a hand-written `.entrypoint` never gets a wrapper either. Nothing ever reads the attribute, and only the MSBuild property puts the guard into the generated .cmd/.sh. Two tests hit that last case, and both are fixed here by restoring the property: - `arrres_il_r` lost `<JitOptimizationSensitive>`. Its whole body is a single `Main`, so unoptimized codegen (tier-0, minopts, JIT stress) keeps the `Test` objects alive in untracked stack slots for the duration of `Main`. They are then never finalized and never resurrected, and the test throws. This is what dotnet#131447 reports; it fails on every default (tiered) run, which is why it showed up across outerloop, jitstress and pgo on all platforms. - `b143840` lost `<GCStressIncompatible>`, leaving it unguarded on gcstress legs. It kept `<RequiresProcessIsolation>` for `<UnloadabilityIncompatible>`. Audited all 16 IL tests carrying `[SkipOnCoreClr]` by evaluating each project's effective `RequiresProcessIsolation` with MSBuild; these two are the only process-isolated ones. The `[SkipOnCoreClr]` attributes are left in place so the guard keeps working if these tests ever stop requiring process isolation. Verified locally on windows-x64 checked with the generated run scripts: arrres_il_r default (tiered) SKIP TieredCompilation=0 PASS (Test passed., 100) TC=0 + JITMinOpts=1 SKIP TC=0 + JitStress=2 SKIP b143840 default PASS GCStress=0xC SKIP Before the change, `arrres_il_r` reproduced the exact CI failure signature (unhandled `System.Exception` in `GCTest_arrres_il.Test.Main`, exit -532462766). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: a984328a-8b6c-4221-b2c9-d668eae5b505
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
Restores MSBuild-based stress guards for process-isolated IL tests by reintroducing the appropriate project properties (since [SkipOnCoreClr] on hand-written IL .entrypoint methods is not evaluated in the out-of-process runner path).
Changes:
- Re-add
<GCStressIncompatible>true</GCStressIncompatible>tob143840.ilproj, with rationale explaining why the MSBuild property is required for process-isolated IL tests. - Re-add
<JitOptimizationSensitive>true</JitOptimizationSensitive>toarrres_il_r.ilproj, with rationale covering both the optimization sensitivity and the process-isolation runner behavior.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/tests/JIT/Regression/CLR-x86-JIT/V1.1-M1-Beta1/b143840/b143840.ilproj | Restores GCStressIncompatible MSBuild guard for a process-isolated IL test and documents why the attribute alone isn’t sufficient. |
| src/tests/JIT/Methodical/Arrays/misc/arrres_il_r.ilproj | Restores JitOptimizationSensitive MSBuild guard for a process-isolated IL test and documents why it must remain. |
Contributor
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch |
jkoritzinsky
approved these changes
Aug 3, 2026
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 freeto 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.
Fixes#131447.
Root cause
Not a JIT bug. #126108 replaced the
<JitOptimizationSensitive>and<GCStressIncompatible>MSBuild properties with[SkipOnCoreClr(...)]attributes on test entry points. That works for C# tests and for in-process IL tests, but silently drops the guard for IL tests that also set<RequiresProcessIsolation>:GenerateStandaloneSimpleTestRunnercompiles the check into__GeneratedMainWrapper.MainExternallyReferencedTestMethodsVisitorOutOfProcessTestthat only callsRunOutOfProcessTest(...)on the generated run script, andReferenceXUnitWrapperGeneratoris gated on'$(Language)' == 'C#'so the IL assembly's hand-written.entrypointnever gets a wrapper eitherIn that last case only the MSBuild property puts the guard into the generated
.cmd/.sh.arrres_il_rkeeps its whole body in a singleMain, so unoptimized codegen (tier-0, minopts, JIT stress) keeps theTestobjects alive in untracked stack slots for the duration ofMain. They are then never finalized and never resurrected, and the test throws. It fails on every default (tiered) run, which is why it lit up across outerloop, jitstress and pgo on all platforms at once.Fix
Restore the MSBuild property on the two affected tests (option 1 from #126108 (comment)):
arrres_il_r.ilproj→<JitOptimizationSensitive>b143840.ilproj→<GCStressIncompatible>(same bug, unguarded on gcstress legs; it kept<RequiresProcessIsolation>for<UnloadabilityIncompatible>)The
[SkipOnCoreClr]attributes are intentionally left in place, so the guard keeps working if either test ever stops requiring process isolation. Each project gets a comment explaining why the property cannot be dropped in favour of the attribute.Fallout audit
I enumerated all 16 IL tests carrying
[SkipOnCoreClr]and evaluated each owning project's effectiveRequiresProcessIsolationwithmsbuild -getProperty(so inheritedDirectory.Build.props/.targetsvalues are accounted for). These two are the only process-isolated ones — the other 14 are in-process and unaffected.I also confirmed empirically, rather than by inspection alone, that both of the "honored" rows above really do emit the guard, by disassembling the built assemblies:
Directed_3.dll(merged runner, in-process IL) containsIsJitStress/IsJitStressRegs/IsJitMinOpts/IsTailCallStress/IsTieredCompilationchecks guarding the call to[AttributeConflict]P::Main().ObjectStackAllocationTests.dll(process-isolated C#) contains the same checks inside__GeneratedMainWrapper.No C# test is affected by this class of bug.
Validation
Built and ran the generated run scripts on windows-x64 checked:
Before the change,
arrres_il_rreproduced the exact CI signature under the default environment: unhandledSystem.ExceptioninGCTest_arrres_il.Test.Main, exit-532462766.cc @jkoritzinsky@jakobbotsch@JulieLeeMSFT