Description
Enabling all runtime-provider keywords can trigger a native lock-order assertion during PGO shutdown tracing on Checked x86 CoreCLR. This was exposed by the new GC-pause keyword test in #134121; the crashing event is JitInstrumentationDataVerbose (298), not GCPause_V1 (304).
Reproduction Steps
Observed in GcPauseDurationRuntimeProviderKeywords(keywords: -1, expectsPause: True) in the linked CI run. The child process requests the expected exit code 42, then crashes during shutdown. A standalone reproducer has not yet been established.
Expected behavior
Shutdown completes without an assertion.
Actual behavior
EnumeratePGOHeaders holds s_pgoMgrLock (CrstLeafLock) while emitting event 298. EventPipe captures a stack, and x86 GetSavedMethodCode attempts to acquire CrstCodeVersioning. This path was confirmed using the CI dump and matching symbols.
Regression?
The emitting code and lock predate #134121. The affected release range is not established.
Known Workarounds
None verified.
Configuration
Windows x86, Checked CoreCLR, Debug libraries; Windows.10.Amd64.Open.
Other information
Test result and dump artifacts.
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1602112
Build error leg or test failing: windows-x86 Debug Libraries_CheckedCoreCLR - System.Diagnostics.Metrics.Tests.RuntimeMetricsTests.GcPauseDurationRuntimeProviderKeywords
Pull request: #134121
KBE authoring guidance (ci-failure-scan)
Error Details is for readers; Build Analysis parses the JSON under Error Message.
ErrorMessage is a case-sensitive literal substring from the failing console log.
- This is not an infrastructure retry case.
Error Details
Assert failure(PID 5920 [0x00001720], Thread: 6224 [0x1850]): Consistency check failed: Crst Level violation: Can't take level 8 lock CrstCodeVersioning because you already holding level 0 lock CrstLeafLock
FAILED: false
CORECLR! CrstBase::IsSafeToTake + 0x35E (0x7351a30e)
CORECLR! CrstBase::Enter + 0xDB (0x73519c6b)
CORECLR! CrstBase::AcquireLock + 0xD (0x7329e7dd)
CORECLR! EECodeInfo::GetNativeCodeVersion + 0x15F (0x735b1fff)
CORECLR! EECodeInfo::GetSavedMethodCode + 0xD6 (0x735b2a96)
CORECLR! Thread::VirtualUnwindCallFrame + 0x3A6 (0x736a82c6)
CORECLR! EECodeManager::EnsureCallerContextIsValid + 0x137 (0x7353dc27)
CORECLR! StackFrameIterator::CheckForSkippedFrames + 0x6E (0x736a41ee)
CORECLR! StackFrameIterator::ProcessCurrentFrame + 0xD6 (0x736a7016)
CORECLR! StackFrameIterator::NextRaw + 0x69B (0x736a6b4b)
File: D:\a\_work\1\s\src\coreclr\vm\crst.cpp:647
Error Message
{
"ErrorMessage": "Consistency check failed: Crst Level violation: Can't take level 8 lock CrstCodeVersioning because you already holding level 0 lock CrstLeafLock",
"ErrorPattern": "",
"BuildRetry": false,
"ExcludeConsoleLog": false
}
Agentic workflow metadata (ci-failure-scan)
Workflow artifact: ci-failure-scan
Artifact kind: kbe-verification
Verified match count: 1 hits in failure.log
### Known issue validation
**Build: 🔎** https://dev.azure.com/dnceng-public/public/_build/results?buildId=1602112
**Error message validated:** `[Consistency check failed: Crst Level violation: Can't take level 8 lock CrstCodeVersioning because you already holding level 0 lock CrstLeafLock`]
**Result validation:** ✅ Known issue matched with the provided build.
**Validation performed at:** 9/18/2026 12:30:50 PM UTC
Description
Enabling all runtime-provider keywords can trigger a native lock-order assertion during PGO shutdown tracing on Checked x86 CoreCLR. This was exposed by the new GC-pause keyword test in #134121; the crashing event is
JitInstrumentationDataVerbose(298), notGCPause_V1(304).Reproduction Steps
Observed in
GcPauseDurationRuntimeProviderKeywords(keywords: -1, expectsPause: True)in the linked CI run. The child process requests the expected exit code 42, then crashes during shutdown. A standalone reproducer has not yet been established.Expected behavior
Shutdown completes without an assertion.
Actual behavior
EnumeratePGOHeadersholdss_pgoMgrLock(CrstLeafLock) while emitting event 298. EventPipe captures a stack, and x86GetSavedMethodCodeattempts to acquireCrstCodeVersioning. This path was confirmed using the CI dump and matching symbols.Regression?
The emitting code and lock predate #134121. The affected release range is not established.
Known Workarounds
None verified.
Configuration
Windows x86, Checked CoreCLR, Debug libraries;
Windows.10.Amd64.Open.Other information
Test result and dump artifacts.
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1602112
Build error leg or test failing: windows-x86 Debug Libraries_CheckedCoreCLR - System.Diagnostics.Metrics.Tests.RuntimeMetricsTests.GcPauseDurationRuntimeProviderKeywords
Pull request: #134121
KBE authoring guidance (ci-failure-scan)
Error Detailsis for readers; Build Analysis parses the JSON underError Message.ErrorMessageis a case-sensitive literal substring from the failing console log.Error Details
Error Message
{ "ErrorMessage": "Consistency check failed: Crst Level violation: Can't take level 8 lock CrstCodeVersioning because you already holding level 0 lock CrstLeafLock", "ErrorPattern": "", "BuildRetry": false, "ExcludeConsoleLog": false }Agentic workflow metadata (ci-failure-scan)
Workflow artifact: ci-failure-scan
Artifact kind: kbe-verification
Verified match count: 1 hits in failure.log