Skip to content

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

Description

@BruceForstall

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

Activity

  1. added
    blocking-outerloopBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs
    on Jun 20, 2022
  2. added this to the 7.0.0 milestone on Jun 20, 2022
  3. BruceForstall commented on Jun 20, 2022

    @BruceForstall
    ContributorAuthor

    @davidwrighton Maybe related to your big #68919?

  4. davidwrighton commented on Jun 21, 2022

    @davidwrighton
    Member

    I'm taking a look now.

  5. ghost added
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 21, 2022
  6. davidwrighton commented on Jun 21, 2022

    @davidwrighton
    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.

  7. ghost removed
    in-prThere is an active PR which will close this issue when it is merged
    on Jun 21, 2022
  8. ghost locked as resolved and limited conversation to collaborators on Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-VM-coreclrblocking-outerloopBlocking the 'runtime-coreclr outerloop' and 'runtime-libraries-coreclr outerloop' runs

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions