Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assert failure: Consistency check failed: Crst Level violation: Can't take level 17 lock CrstInstMethodHashTable because you already holding level 17 lock CrstInstMethodHashTable #71023

Closed
BruceForstall opened this issue Jun 20, 2022 · 4 comments · Fixed by #71076
Labels
area-VM-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs
Milestone

Comments

@BruceForstall
Copy link
Member

Lots of threading tests are failing, on all platforms, with this assert.

https://dev.azure.com/dnceng/public/_build/results?buildId=1834785&view=ms.vss-test-web.build-test-results-tab

e.g.,

    baseservices\threading\generics\WaitCallback\thread23\thread23.cmd [FAIL]
      
      Assert failure(PID 7968 [0x00001f20], Thread: 5880 [0x16f8]): Consistency check failed: Crst Level violation: Can't take level 17 lock CrstInstMethodHashTable because you already holding level 17 lock CrstInstMethodHashTable
      FAILED: false
      
      CORECLR! CHECK::Trigger + 0x2D1 (0x00007ffc`005929b1)
      CORECLR! CrstBase::IsSafeToTake + 0x36D (0x00007ffb`ffeb044d)
      CORECLR! CrstBase::Enter + 0x196 (0x00007ffb`ffeafd56)
      CORECLR! InstantiatedMethodDesc::NewInstantiatedMethodDesc + 0xC0C (0x00007ffc`001c3c8c)
      CORECLR! MethodDesc::FindOrCreateAssociatedMethodDesc + 0x21E8 (0x00007ffc`001bff78)
      CORECLR! MethodDesc::FindOrCreateAssociatedMethodDesc + 0x20FA (0x00007ffc`001bfe8a)
      CORECLR! MethodDesc::FindOrCreateAssociatedMethodDesc + 0x1612 (0x00007ffc`001bf3a2)
      CORECLR! MethodDesc::ResolveGenericVirtualMethod + 0xB18 (0x00007ffb`fffbae38)
      CORECLR! MethodDesc::GetMultiCallableAddrOfVirtualizedCode + 0x3C4 (0x00007ffb`fffb4014)
      CORECLR! JIT_VirtualFunctionPointer_Framed + 0x321 (0x00007ffc`00234ae1)
          File: D:\a\_work\1\s\src\coreclr\vm\crst.cpp Line: 763
          Image: C:\h\w\B71709A2\p\corerun.exe
      
      
      Return code:      1
      Raw output file:      C:\h\w\B71709A2\w\AE8609CF\uploads\Reports\baseservices.threading\generics\WaitCallback\thread23\thread23.output.txt
      Raw output:
      BEGIN EXECUTION
       "C:\h\w\B71709A2\p\corerun.exe" -p "System.Reflection.Metadata.MetadataUpdater.IsSupported=false"  thread23.dll 
      Expected: 100
      Actual: -1073740286
      END EXECUTION - FAILED
@BruceForstall BruceForstall added the blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs label Jun 20, 2022
@BruceForstall BruceForstall added this to the 7.0.0 milestone Jun 20, 2022
@BruceForstall
Copy link
Member Author

@davidwrighton Maybe related to your big #68919?

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label.

@davidwrighton
Copy link
Member

I'm taking a look now.

@ghost ghost added the in-pr There is an active PR which will close this issue when it is merged label Jun 21, 2022
@davidwrighton
Copy link
Member

The problem is in the adjusted computation of ComputeLoaderModule. With the new logic the loader module may be different, which will cause different hashtables for the instMethodHash to be used. This can cause this problem. I'll be looking into what to do to fix this, and if its an already existing problem for some of the loader module patterns we already have, but in the meantime, I'm going to revert my larger change.

@ghost ghost removed the in-pr There is an active PR which will close this issue when it is merged label Jun 21, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Jul 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-coreclr blocking-outerloop Blocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs
Projects
None yet
2 participants