Repository navigation
Description
Assert failure(PID 6052 [0x000017a4], Thread: 63069 [0xf65d]): Consistency check failed: Crst Level violation: Can't take level 17 lock CrstLoaderAllocatorReferences because you already holding level 14 lock CrstILStubGen
FAILED: false
File: /Users/runner/work/1/s/src/coreclr/vm/crst.cpp:683
Image: /private/tmp/helix/working/A6FA0928/p/dotnet
Build Information
Build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1336431
Build error leg or test failing:
Error Message
Fill the error message using step by step known issues guidance.
{
"ErrorMessage": "Consistency check failed: Crst Level violation: Can't take level 17 lock CrstLoaderAllocatorReferences because you already holding level 14 lock CrstILStubGen",
"BuildRetry": false,
"ExcludeConsoleLog": false
}Known issue validation
Build: 🔎
Result validation:
Validation performed at: 3/16/2026 11:03:35 PM UTC
Known issue validation
Build: 🔎
Result validation:
Validation performed at: 3/16/2026 11:04:23 PM UTC
Known issue validation
Build: 🔎 https://dev.azure.com/dnceng-public/public/_build/results?buildId=1336431
Error message validated: [Consistency check failed: Crst Level violation: Can't take level 17 lock CrstLoaderAllocatorReferences because you already holding level 14 lock CrstILStubGen]
Result validation: ✅ Known issue matched with the provided build.
Validation performed at: 3/16/2026 11:05:48 PM UTC
Report
Summary
| 24-Hour Hit Count | 7-Day Hit Count | 1-Month Count |
|---|---|---|
| 28 | 29 | 29 |
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
[-]Consistency check failed: Crst Level violation: Can't take level 17 lock CrstLoaderAllocatorReferences because you already holding level 14 lock CrstILStubGen[/-][+]Crst Level violation: Can't take level 17 lock CrstLoaderAllocatorReferences[/+]dotnet-policy-service commentedon Mar 16, 2026
Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.
dotnet-policy-service commentedon Mar 16, 2026
Tagging subscribers to this area: @agocke
See info in area-owners.md if you want to be subscribed.
jkotas commentedon Mar 17, 2026
@EgorBo This was introduced by your PR #125574 .
jkotas commentedon Mar 17, 2026
Stacktrace of the assert:
EgorBo commentedon Mar 17, 2026
ouch 😞, definitely didn't expect a change in C# code to run into runtime lock asserts so didn't even check it, looking now
jkotas commentedon Mar 17, 2026
The changes exposed a pre-existing bug in the type loader. I think we want to do partial revert to get CI on track, and then take the time to implement a proper fix.
EgorBo commentedon Mar 17, 2026
@jkotas copilot says:
Root cause: Debug_CanTake() in EnsureInstantiation/EnsureReference actually enters/leaves the CrstLoaderAllocatorReferences lock, triggering lock-level checks. When called during IL stub
creation (which holds CrstILStubGen at level 14), the check fails because CrstLoaderAllocatorReferences is level 17. This fires even for non-collectible types that never actually take the
lock.
Changes (3 files, 8 lines):
lock will actually be taken.
and sent the fix via #125675
I'm not an expert to say if it's correct, though. From what I understand it sounds reasonable.
Fix CrstILStubGen/CrstLoaderAllocatorReferences lock level violation (#…
kg commentedon Mar 19, 2026
This is still failing for me on #125669, see https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-125669-merge-96d12d268ba24ea4b8/System.Net.NetworkInformation.Functional.Tests/1/console.17032606.log?helixlogtype=result and https://helixr1107v0xdeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-125669-merge-96d12d268ba24ea4b8/System.Net.Primitives.Pal.Tests/1/console.49ec71b6.log?helixlogtype=result
jkotas commentedon Mar 19, 2026
I think this test run did not have the fix. The error message says "level 14 lock CrstILStubGen". The fix changed 14 to 18.