Repository navigation
Enable GC stress for ReadyToRun code - #135794
Conversation
|
Azure Pipelines: Successfully started running 4 pipeline(s). 12 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
|
Tagging subscribers to this area: @anicka-net, @dotnet/gc |
|
/azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
Co-authored-by: VSadov <8218165+VSadov@users.noreply.github.com>
Co-authored-by: VSadov <8218165+VSadov@users.noreply.github.com>
8909fd0 to
c9bf9db
Compare
|
/azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc |
|
@copilot - we do not want to add tests with this PR since. This is a test infrastructure change. There are plenty of tests that it runs already. Please remove all added tests. |
Co-authored-by: VSadov <8218165+VSadov@users.noreply.github.com>
Removed all four GC stress test source/project files added by this PR in commit |
|
/azp run runtime-coreclr gcstress-extra, runtime-coreclr gcstress0x3-gcstress0xc |
|
/azp run runtime-coreclr r2r-extra |
|
Azure Pipelines: Successfully started running 2 pipeline(s). |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
|
The PR matches the baseline, with essentially identical failures. This time both PRs were run together, so the comparison is same-day. The PR head is Scenarios: no difference. Both ran the same 51 jobs, and the same 6 top-level jobs failed (3 pipelines plus their Helix monitors).
Caveats:
I haven't checked which PR commit fixed the x86 crashes. They were already gone at the previous check. |
|
/ba-g test failures unrelated/known. stress failures are the same as in a no-op run. |
Thanks for asking me to work on this. I will get started on it and keep this PR's description up to date as I form a plan and make progress. > ---- > > *This section details on the original issue you should resolve* > > <issue_title>Assert failure: !th.IsNull()</issue_title> > <issue_description>## Build Information > Build: https://dev.azure.com/dnceng-public/cbb18261-c48f-4abb-8651-8cdcb5474649/_build/results?buildId=1654712 > Build error leg or test failing: OutOfProcessTest.JIT/Regression_3/DevDiv_461649/DevDiv_461649/DevDiv_461649.cmd > <!-- Error message template --> > ## Error Message > > Fill the error message using [step by step known issues guidance](https://github.com/dotnet/arcade/blob/main/Documentation/Build%20Analysis/KnownIssueJsonStepByStep.md). > > <!-- Use ErrorMessage for String.Contains matches. Use ErrorPattern for regex matches (single line/no backtracking). Set BuildRetry to `true` to retry builds with this error. Set ExcludeConsoleLog to `true` to skip helix logs analysis. --> > > ```json > { > "ErrorMessage": "Failed test: OutOfProcessTest.JIT/Regression_3/DevDiv_461649/DevDiv_461649/DevDiv_461649.cmd", > "BuildRetry": false, > "ExcludeConsoleLog": false > } > ``` > > <!-- Known issue validation start --> > ### Known issue validation > **Build: 🔎** https://dev.azure.com/dnceng-public/public/_build/results?buildId=1654712 > **Error message validated:** `[Failed test: OutOfProcessTest.JIT/Regression_3/DevDiv_461649/DevDiv_461649/DevDiv_461649.cmd`] > **Result validation:** ❌ Known issue did not match with the provided build. > **Validation performed at:** 10/30/2026 1:07:04 AM UTC > <!-- Known issue validation end --> > <!--Known issue error report start --> > > ### Report > #### Summary > |24-Hour Hit Count|7-Day Hit Count|1-Month Count| > |---|---|---| > |0|0|0| > <!--Known issue error report end --></issue_description> > - Closes #136674 > > <agent_instructions>Re: also fails in #135794 > > **What fails** > > On x86 (non-Unix), `ResolveWorker` builds a resolve stub for a virtual or interface call. The stub needs the number of stack bytes the callee pops, so it calls `pMD->SizeOfArgStack()` on the method from the dispatch token. That call walks the method signature. For a value-type parameter or return it needs the type layout already loaded, because it runs under `ENABLE_FORBID_GC_LOADER_USE`. Otherwise `!th.IsNull()` asserts. > > **Why it started** > > Before #135805, the R2R caller's fixups loaded those types. Now `ExternalMethodFixupWorker` calls `PrepareForUseAsAVirtualCallTargetOfANativeImage(pGCRefMap)`. For a plain instance method with an import map, it only stores the map via `SetGCRefMap` and returns. So the method has a map but its value types may be unloaded. > > **The fix** > > The x86 GCRefMap already encodes the stack-pop size. The runtime already trusts it for the same purpose in `UpdateRegDisplay_Impl` (via `CbStackPopUsingGCRefMap`). For non-vararg methods, `CbStackPop()` equals `SizeOfArgStack()`. > > ```cpp > PTR_BYTE pGCRefMap = pMD->FindGCRefMap(objectType, true /* isDispatch */); > if (pGCRefMap != NULL) > { > GCRefMapDecoder decoder(pGCRefMap); > stackArgumentsSize = decoder.ReadStackPop() * sizeof(TADDR); > } > else > { > ENABLE_FORBID_GC_LOADER_USE_IN_THIS_SCOPE(); > stackArgumentsSize = pMD->SizeOfArgStack(); // unchanged fallback > } > ``` > > - It uses the same lookup `StubDispatchFrame` uses for GC scanning. > - Nothing is loaded and the scope isn't relaxed. It also adds `#include "gcrefmap.h"`, and it stays inside the existing x86 `#if`. > - The fallback should be safe. As far as I can tell from reading, preparation skips the load only when it stores a shareable map. Generic methods and methods that need a hidden generic argument are fully prepared. I haven't confirmed that. > > </agent_instructions> > > ## Comments on the Issue (you are @copilot in this section) > > <comments> > <comment_new><author>@jkotas</author><body> > Regression likely caused by #135806 cc @davidwrighton </body></comment_new> > </comments> - Fixes #136674 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: VSadov <8218165+VSadov@users.noreply.github.com> Co-authored-by: David Wrighton <davidwr@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 6e1d3f7f-a06c-4561-8189-bdf699656b46
Instruction-level GC stress currently instruments JIT-compiled code but skips ReadyToRun methods.
SetupGcCoveragebefore publishing R2R entry points, including async resumption stubs. Serialize setup and use canonical method identity/default code versions for shared generic code.