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

Critical section level violation in Interop codebase #44114

Closed
davidwrighton opened this issue Oct 31, 2020 · 6 comments · Fixed by #45372
Closed

Critical section level violation in Interop codebase #44114

davidwrighton opened this issue Oct 31, 2020 · 6 comments · Fixed by #45372
Labels
area-Interop-coreclr blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' bug
Milestone

Comments

@davidwrighton
Copy link
Member

Description

Critical section level order violation in interop codebase. Code in DispatchInfo::SynchWithManagedView takes a lock of level CrstInterop but then calls into managed code which may implicitly trigger CrstPendingTypeLoadEntry. While this may not repro consistently, this is a bug as any call into managed code may trigger a type load. There are 3 possible fixes

  1. Make the Interop lock level have a dependency on PendingTypeLoadEntry
  2. Use a different lock level for this particular lock, which has a dependency on PendingTypeLoadEntry
  3. Move the lock to managed code.

When running tests the following assertion appeared

Assert failure(PID 4060 [0x00000fdc], Thread: 3368 [0x0d28]): Consistency check failed: Crst Level violation: Can't take level 19 lock CrstPendingTypeLoadEntry because you already holding level 18 lock CrstInterop
FAILED: false

CORECLR! CHECK::Trigger + 0x310 (0x6ea611b0)
CORECLR! CrstBase::IsSafeToTake + 0x30A (0x6e5b6e4a)
CORECLR! CrstBase::Enter + 0x152 (0x6e5b6860)
CORECLR! CrstBase::AcquireLock + 0xD (0x6e4f58a2)
CORECLR! ClassLoader::LoadTypeHandleForTypeKey_Body + 0x502 (0x6e590668)
CORECLR! ClassLoader::LoadTypeHandleForTypeKey + 0x19A (0x6e58fc3e)
CORECLR! ClassLoader::LoadTypeDefThrowing + 0x89E (0x6e58f8be)
CORECLR! ClassLoader::LoadTypeDefOrRefThrowing + 0x6E0 (0x6e58ee9d)
CORECLR! SigPointer::GetTypeHandleThrowing + 0xC4B (0x6e6d7106)
CORECLR! MethodTableBuilder::InitializeFieldDescs + 0xC0E (0x6e850802)
    File: F:\workspace\_work\1\s\src\coreclr\src\vm\crst.cpp Line: 765
    Image: C:\h\w\AEF80955\p\CoreRun.exe

Return code:      1
Raw output file:      C:\h\w\AEF80955\w\B1520949\e\Interop\PInvoke\Reports\Interop.PInvoke\Delegate\DelegateTest\DelegateTest.output.txt
Raw output:
BEGIN EXECUTION
 "C:\h\w\AEF80955\p\corerun.exe" DelegateTest.dll 
Expected: 100
Actual: -1073740286
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:
> set CORE_ROOT=C:\h\w\AEF80955\p
> C:\h\w\AEF80955\w\B1520949\e\Interop\PInvoke\Delegate\DelegateTest\DelegateTest.cmd

From looking at the dump, the callstack apppears as

 # ChildEBP RetAddr      
00 02777a90 6ea80216     coreclr!TerminateOnAssert+0x17 [F:\workspace\_work\1\s\src\coreclr\src\utilcode\debug.cpp @ 189] 
01 02777b68 6ea7f84b     coreclr!_DbgBreakCheck+0x411 [F:\workspace\_work\1\s\src\coreclr\src\utilcode\debug.cpp @ 427] 
02 02777bd8 6ea7fb73     coreclr!_DbgBreakCheckNoThrow+0x51 [F:\workspace\_work\1\s\src\coreclr\src\utilcode\debug.cpp @ 534] 
03 02777c74 6ea611b0     coreclr!DbgAssertDialog+0x20b [F:\workspace\_work\1\s\src\coreclr\src\utilcode\debug.cpp @ 695] 
04 02777d18 6e5b6e4a     coreclr!CHECK::Trigger+0x310 [F:\workspace\_work\1\s\src\coreclr\src\utilcode\check.cpp @ 139] 
05 02777dac 6e5b6860     coreclr!CrstBase::IsSafeToTake+0x30a [F:\workspace\_work\1\s\src\coreclr\src\vm\crst.cpp @ 761] 
06 02777ddc 6e4f58a2     coreclr!CrstBase::Enter+0x152 [F:\workspace\_work\1\s\src\coreclr\src\vm\crst.cpp @ 305] 
07 02777de8 6e590668     coreclr!CrstBase::AcquireLock+0xd [F:\workspace\_work\1\s\src\coreclr\src\vm\crst.h @ 188] 
08 (Inline) --------     coreclr!CrstBase::CrstHolder::{ctor}+0xc [F:\workspace\_work\1\s\src\coreclr\src\vm\crst.h @ 382] 
09 02777f48 6e58fc3e     coreclr!ClassLoader::LoadTypeHandleForTypeKey_Body+0x502 [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 3804] 
0a 02778034 6e58f8be     coreclr!ClassLoader::LoadTypeHandleForTypeKey+0x19a [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 3613] 
0b 02778200 6e58ee9d     coreclr!ClassLoader::LoadTypeDefThrowing+0x89e [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 2501] 
0c 0277833c 6e6d7106     coreclr!ClassLoader::LoadTypeDefOrRefThrowing+0x6e0 [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 2673] 
0d 027784f8 6e850802     coreclr!SigPointer::GetTypeHandleThrowing+0xc4b [F:\workspace\_work\1\s\src\coreclr\src\vm\siginfo.cpp @ 1487] 
0e 027786cc 6e842cbb     coreclr!MethodTableBuilder::InitializeFieldDescs+0xc0e [F:\workspace\_work\1\s\src\coreclr\src\vm\methodtablebuilder.cpp @ 4035] 
0f 0277926c 6e846f50     coreclr!MethodTableBuilder::BuildMethodTableThrowing+0x11dd [F:\workspace\_work\1\s\src\coreclr\src\vm\methodtablebuilder.cpp @ 1705] 
10 0277b700 6e5870f3     coreclr!ClassLoader::CreateTypeHandleForTypeDefThrowing+0x1243 [F:\workspace\_work\1\s\src\coreclr\src\vm\methodtablebuilder.cpp @ 12245] 
11 0277b880 6e587e3c     coreclr!ClassLoader::CreateTypeHandleForTypeKey+0x2bf [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 3197] 
12 0277b990 6e590a00     coreclr!ClassLoader::DoIncrementalLoad+0x376 [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 3126] 
13 0277bafc 6e58fc3e     coreclr!ClassLoader::LoadTypeHandleForTypeKey_Body+0x89a [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 3894] 
14 0277bbe8 6e58f8be     coreclr!ClassLoader::LoadTypeHandleForTypeKey+0x19a [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 3613] 
15 0277bdb4 6e67c3e2     coreclr!ClassLoader::LoadTypeDefThrowing+0x89e [F:\workspace\_work\1\s\src\coreclr\src\vm\clsload.cpp @ 2501] 
16 0277be70 6e732f34     coreclr!MemberLoader::GetMethodDescFromMethodDef+0x199 [F:\workspace\_work\1\s\src\coreclr\src\vm\memberload.cpp @ 605] 
17 0277bf18 6e732c7f     coreclr!ZapSig::DecodeMethod+0x297 [F:\workspace\_work\1\s\src\coreclr\src\vm\zapsig.cpp @ 863] 
18 0277bfc0 6e641b97     coreclr!ZapSig::DecodeMethod+0xb3 [F:\workspace\_work\1\s\src\coreclr\src\vm\zapsig.cpp @ 781] 
19 0277c2d4 6e558000     coreclr!LoadDynamicInfoEntry+0x642 [F:\workspace\_work\1\s\src\coreclr\src\vm\jitinterface.cpp @ 13391] 
1a 0277c384 6e734739     coreclr!Module::FixupNativeEntry+0x1a0 [F:\workspace\_work\1\s\src\coreclr\src\vm\ceeload.cpp @ 10280] 
1b 0277c444 6e735afc     coreclr!Module::FixupDelayListAux<Module *,int (__thiscall Module::*)(CORCOMPILE_IMPORT_SECTION *,unsigned long,unsigned long *)>+0x34a [F:\workspace\_work\1\s\src\coreclr\src\vm\ceeload.inl @ 584] 
1c (Inline) --------     coreclr!Module::FixupDelayList+0x39 [F:\workspace\_work\1\s\src\coreclr\src\vm\ceeload.inl @ 487] 
1d 0277c520 6e6c0698     coreclr!ReadyToRunInfo::GetEntryPoint+0x2c0 [F:\workspace\_work\1\s\src\coreclr\src\vm\readytoruninfo.cpp @ 898] 
1e 0277c59c 6e6c053d     coreclr!MethodDesc::GetPrecompiledR2RCode+0x9a [F:\workspace\_work\1\s\src\coreclr\src\vm\prestub.cpp @ 585] 
1f 0277c61c 6e6c2929     coreclr!MethodDesc::GetPrecompiledCode+0x89 [F:\workspace\_work\1\s\src\coreclr\src\vm\prestub.cpp @ 439] 
20 0277c698 6e6c2762     coreclr!MethodDesc::PrepareILBasedCode+0x195 [F:\workspace\_work\1\s\src\coreclr\src\vm\prestub.cpp @ 396] 
21 0277c70c 6e59f646     coreclr!MethodDesc::PrepareCode+0xb0 [F:\workspace\_work\1\s\src\coreclr\src\vm\prestub.cpp @ 342] 
22 0277c874 6e6bdf1d     coreclr!CodeVersionManager::PublishVersionableCodeIfNecessary+0x25d [F:\workspace\_work\1\s\src\coreclr\src\vm\codeversion.cpp @ 1701] 
23 0277ca38 6e6c4a0d     coreclr!MethodDesc::DoPrestub+0x724 [F:\workspace\_work\1\s\src\coreclr\src\vm\prestub.cpp @ 2170] 
24 0277cb5c 6ea4c60c     coreclr!PreStubWorker+0x31d [F:\workspace\_work\1\s\src\coreclr\src\vm\prestub.cpp @ 1995] 
25 0277cb80 6dfbfd0e     coreclr!ThePreStub+0x11 [F:\workspace\_work\1\s\src\coreclr\src\vm\i386\asmhelpers.asm @ 1544] 
26 0277cba8 6ea4c2d1     System_Private_CoreLib!System.RuntimeType.GetProperties(System.Reflection.BindingFlags)$##60005D7+0x1e
27 0277cbb4 6e74ad99     coreclr!CallDescrWorkerInternal+0x34 [F:\workspace\_work\1\s\src\coreclr\src\vm\i386\asmhelpers.asm @ 606] 
28 0277cfd4 6e74aef1     coreclr!CallDescrWorker+0xd7 [F:\workspace\_work\1\s\src\coreclr\src\vm\callhelpers.cpp @ 130] 
29 0277d050 6e74b576     coreclr!CallDescrWorkerWithHandler+0xf6 [F:\workspace\_work\1\s\src\coreclr\src\vm\callhelpers.cpp @ 73] 
2a 0277d2b0 6e9896a1     coreclr!MethodDescCallSite::CallTargetWorker+0x64f [F:\workspace\_work\1\s\src\coreclr\src\vm\callhelpers.cpp @ 555] 
2b (Inline) --------     coreclr!MethodDescCallSite::Call_RetOBJECTREF+0x22 [F:\workspace\_work\1\s\src\coreclr\src\vm\callhelpers.h @ 461] 
2c 0277d3d4 6e98c356     coreclr!DispatchInfo::RetrievePropList+0x101 [F:\workspace\_work\1\s\src\coreclr\src\vm\dispatchinfo.cpp @ 2937] 
2d 0277d538 6e959004     coreclr!DispatchInfo::SynchWithManagedView+0x263 [F:\workspace\_work\1\s\src\coreclr\src\vm\dispatchinfo.cpp @ 2768] 
2e 0277d608 6e9d0c74     coreclr!ComMethodTable::GetDispatchInfo+0x20b [F:\workspace\_work\1\s\src\coreclr\src\vm\comcallablewrapper.cpp @ 4070] 
2f 0277d73c 6e9e104a     coreclr!InternalDispatchImpl_GetIDsOfNames+0x38b [F:\workspace\_work\1\s\src\coreclr\src\vm\stdinterfaces.cpp @ 1385] 
30 0277d870 6e9e1161     coreclr!InternalDispatchImpl_GetIDsOfNames_CallBack+0x43a [F:\workspace\_work\1\s\src\coreclr\src\vm\stdinterfaces_wrapper.cpp @ 1056] 
31 0277d948 6d931161     coreclr!InternalDispatchImpl_GetIDsOfNames_Wrapper+0xd1 [F:\workspace\_work\1\s\src\coreclr\src\vm\stdinterfaces_wrapper.cpp @ 1084] 
WARNING: Stack unwind information not available. Following frames may be wrong.
32 0277d98c 6d9312c2     DelegateTestNative!ValidateDelegateReturnsExpected+0x61
33 0277d9ac 07d5b8c7     DelegateTestNative!ValidateDelegateValueMatchesExpected+0x12
34 0277da08 07d5b564     0x7d5b8c7
35 0277daa8 07d59e0a     0x7d5b564
36 0277dad8 6ea4c2d1     0x7d59e0a
37 0277dae4 6e74ad99     coreclr!CallDescrWorkerInternal+0x34 [F:\workspace\_work\1\s\src\coreclr\src\vm\i386\asmhelpers.asm @ 606] 
38 0277df04 6e74aef1     coreclr!CallDescrWorker+0xd7 [F:\workspace\_work\1\s\src\coreclr\src\vm\callhelpers.cpp @ 130] 
39 0277df80 6e74b576     coreclr!CallDescrWorkerWithHandler+0xf6 [F:\workspace\_work\1\s\src\coreclr\src\vm\callhelpers.cpp @ 73] 
3a 0277e1dc 6e52bf14     coreclr!MethodDescCallSite::CallTargetWorker+0x64f [F:\workspace\_work\1\s\src\coreclr\src\vm\callhelpers.cpp @ 555] 
3b (Inline) --------     coreclr!MethodDescCallSite::Call_RetArgSlot+0x99 [F:\workspace\_work\1\s\src\coreclr\src\vm\callhelpers.h @ 458] 
3c 0277e304 6e52bb0d     coreclr!RunMainInternal+0x1b0 [F:\workspace\_work\1\s\src\coreclr\src\vm\assembly.cpp @ 1468] 
3d 0277e340 6e52bbbb     coreclr!``RunMain'::`29'::__Body::Run'::`5'::__Body::Run+0x40 [F:\workspace\_work\1\s\src\coreclr\src\vm\assembly.cpp @ 1538] 
3e 0277e394 6e52bce5     coreclr!`RunMain'::`29'::__Body::Run+0x5d [F:\workspace\_work\1\s\src\coreclr\src\vm\assembly.cpp @ 1538] 
3f 0277e3f4 6e527bad     coreclr!RunMain+0xc5 [F:\workspace\_work\1\s\src\coreclr\src\vm\assembly.cpp @ 1538] 
40 0277e750 6e5b4919     coreclr!Assembly::ExecuteMainMethod+0x1ba [F:\workspace\_work\1\s\src\coreclr\src\vm\assembly.cpp @ 1648] 
41 0277e8b8 6e4ed382     coreclr!CorHost2::ExecuteAssembly+0x4a9 [F:\workspace\_work\1\s\src\coreclr\src\vm\corhost.cpp @ 385] 
42 0277e918 0022a69a     coreclr!coreclr_execute_assembly+0x92 [F:\workspace\_work\1\s\src\coreclr\src\dlls\mscoree\unixinterface.cpp @ 431] 
43 0277e93c 0022a5e6     CoreRun!HostEnvironment::ExecuteAssembly+0x2a [F:\workspace\_work\1\s\src\coreclr\src\hosts\corerun\corerun.cpp @ 351] 
44 0277ed08 0022ecaa     CoreRun!ExecuteAssembly+0x35a [F:\workspace\_work\1\s\src\coreclr\src\hosts\corerun\corerun.cpp @ 636] 
45 0277fb98 0022f876     CoreRun!TryRun+0x3ed [F:\workspace\_work\1\s\src\coreclr\src\hosts\corerun\corerun.cpp @ 773] 
46 0277fbe8 0024cef3     CoreRun!wmain+0x98 [F:\workspace\_work\1\s\src\coreclr\src\hosts\corerun\corerun.cpp @ 854] 
47 0277fc08 0024cdc7     CoreRun!invoke_main+0x33 [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 90] 
48 0277fc64 0024cc6d     CoreRun!__scrt_common_main_seh+0x157 [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 288] 
49 0277fc6c 0024cf58     CoreRun!__scrt_common_main+0xd [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl @ 331] 
4a 0277fc74 73fe62c4     CoreRun!wmainCRTStartup+0x8 [d:\agent\_work\3\s\src\vctools\crt\vcstartup\src\startup\exe_wmain.cpp @ 17] 
4b 0277fc88 76f81e39     kernel32!BaseThreadInitThunk+0x24
4c 0277fcd0 76f81e04     ntdll!__RtlUserThreadStart+0x2f
4d 0277fce0 00000000     ntdll!_RtlUserThreadStart+0x1b

Configuration

This appeared while running standard PR tests on a Windows X86 Checked leg.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Oct 31, 2020
@Dotnet-GitSync-Bot
Copy link
Collaborator

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.

@v-haren
Copy link

v-haren commented Nov 5, 2020

failed again in job: runtime-coreclr crossgen2-composite 20201103.1

failed test: Interop\PInvoke\Delegate\DelegateTest\DelegateTest.cmd

R2R-CG2 windows x86 Checked @ Windows.10.Amd64.Open

Error message

Could Not Find C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\composite-r2r.dll.rsp

Assert failure(PID 7872 [0x00001ec0], Thread: 2500 [0x09c4]): Consistency check failed: Crst Level violation: Can't take level 19 lock CrstPendingTypeLoadEntry because you already holding level 18 lock CrstInterop
FAILED: false

CORECLR! CHECK::Trigger + 0x310 (0x698ec150)
CORECLR! CrstBase::IsSafeToTake + 0x30A (0x6944481a)
CORECLR! CrstBase::Enter + 0x152 (0x69444230)
CORECLR! CrstBase::AcquireLock + 0xD (0x6937e887)
CORECLR! ClassLoader::LoadTypeHandleForTypeKey_Body + 0x502 (0x6941e017)
CORECLR! ClassLoader::LoadTypeHandleForTypeKey + 0x19A (0x6941d5ed)
CORECLR! ClassLoader::LoadTypeDefThrowing + 0x89E (0x6941d26d)
CORECLR! ClassLoader::LoadTypeDefOrRefThrowing + 0x6E0 (0x6941c84c)
CORECLR! SigPointer::GetTypeHandleThrowing + 0xC4B (0x69564ee4)
CORECLR! MethodTableBuilder::InitializeFieldDescs + 0xC0E (0x696de691)
    File: F:\workspace\_work\1\s\src\coreclr\src\vm\crst.cpp Line: 765
    Image: C:\h\w\B75809E4\p\CoreRun.exe


Return code:      1
Raw output file:      C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Reports\Interop.PInvoke\Delegate\DelegateTest\DelegateTest.output.txt
Raw output:
BEGIN EXECUTION
DelegateTest.dll
DelegateTestNative.dll
TestLibrary.dll
        3 file(s) copied.
Response file: C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\\composite-r2r.dll.rsp
C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\IL\.dll
-o:C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\\composite-r2r.dll
--targetarch:x86
--verify-type-and-field-layout
-O
-r:C:\h\w\B75809E4\p\System..dll
-r:C:\h\w\B75809E4\p\Microsoft.*.dll
-r:C:\h\w\B75809E4\p\mscorlib.dll
-r:C:\h\w\B75809E4\p\netstandard.dll
" "dotnet" "C:\h\w\B75809E4\p\crossgen2\crossgen2.dll" @"C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\\composite-r2r.dll.rsp"   --composite"
Emitting R2R PE file: C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\\composite-r2r.dll
Emitting R2R PE file: C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\DelegateTest.dll
Emitting R2R PE file: C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\TestLibrary.dll
 "C:\h\w\B75809E4\p\corerun.exe" DelegateTest.dll 
Expected: 100
Actual: -1073740286
END EXECUTION - FAILED
FAILED
Test Harness Exitcode is : 1
To run the test:
> set CORE_ROOT=C:\h\w\B75809E4\p
> C:\h\w\B75809E4\w\94D308B1\e\Interop\PInvoke\Delegate\DelegateTest\DelegateTest.cmd
Expected: True
Actual:   False


Stack trace
   at Interop_PInvoke._Delegate_DelegateTest_DelegateTest_._Delegate_DelegateTest_DelegateTest_cmd() in F:\workspace\_work\1\s\artifacts\tests\coreclr\windows.x86.Checked\TestWrappers\Interop.PInvoke\Interop.PInvoke.XUnitWrapper.cs:line 6894

@AaronRobinsonMSFT AaronRobinsonMSFT removed the untriaged New issue has not been triaged by the area owner label Nov 10, 2020
@AaronRobinsonMSFT AaronRobinsonMSFT added this to the 6.0.0 milestone Nov 10, 2020
@stephentoub
Copy link
Member

Failed again here:
https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-44409-merge-b7a41350efde4a59b4/Interop/console.38d76281.log?sv=2019-07-07&se=2020-12-02T03%3A32%3A10Z&sr=c&sp=rl&sig=t4O7j4lyv%2BvVAR0epTe%2Ff1Niiy5ZvsB92MMpYN2GvE0%3D

    Interop\COM\NETClients\Events\NETClientEvents\NETClientEvents.cmd [FAIL]
      
      Assert failure(PID 2304 [0x00000900], Thread: 644 [0x0284]): Consistency check failed: Crst Level violation: Can't take level 19 lock CrstPendingTypeLoadEntry because you already holding level 18 lock CrstInterop
      FAILED: false
      
      CORECLR! CHECK::Trigger + 0x2C9 (0x00007ff8`1432e079)
      CORECLR! CrstBase::IsSafeToTake + 0x3D8 (0x00007ff8`13d0c15c)
      CORECLR! CrstBase::Enter + 0x210 (0x00007ff8`13d0ba00)
      CORECLR! ClassLoader::LoadTypeHandleForTypeKey_Body + 0x73F (0x00007ff8`13cda38f)
      CORECLR! ClassLoader::LoadTypeHandleForTypeKey + 0x206 (0x00007ff8`13cd94e2)
      CORECLR! ClassLoader::LoadTypeDefThrowing + 0xC47 (0x00007ff8`13cd901f)
      CORECLR! ClassLoader::LoadTypeDefOrRefThrowing + 0x9AC (0x00007ff8`13cd8240)
      CORECLR! SigPointer::GetTypeHandleThrowing + 0xC4F (0x00007ff8`13e84f2b)
      CORECLR! ZapSig::DecodeType + 0x126 (0x00007ff8`13eff1fa)
      CORECLR! LoadDynamicInfoEntry + 0xC5F (0x00007ff8`13dbc9b7)
          File: F:\workspace\_work\1\s\src\coreclr\src\vm\crst.cpp Line: 765
          Image: C:\h\w\B1340951\p\CoreRun.exe

@VSadov
Copy link
Member

VSadov commented Nov 13, 2020

Failed in https://helixre8s23ayyeko0k025g8.blob.core.windows.net/dotnet-runtime-refs-pull-44505-merge-5dbe14770a7d4aada4/Interop/console.61541b44.log?sv=2019-07-07&se=2020-12-03T21%3A10%3A28Z&sr=c&sp=rl&sig=yJ9rE3wKmEa1ZdDerR6TYaQ6pfwxsWBvIojGZJIo%2Bkg%3D

    Interop\COM\NETClients\Events\NETClientEvents\NETClientEvents.cmd [FAIL]
      
      Assert failure(PID 2304 [0x00000900], Thread: 644 [0x0284]): Consistency check failed: Crst Level violation: Can't take level 19 lock CrstPendingTypeLoadEntry because you already holding level 18 lock CrstInterop
      FAILED: false
      
      CORECLR! CHECK::Trigger + 0x2C9 (0x00007ff8`1432e079)
      CORECLR! CrstBase::IsSafeToTake + 0x3D8 (0x00007ff8`13d0c15c)
      CORECLR! CrstBase::Enter + 0x210 (0x00007ff8`13d0ba00)
      CORECLR! ClassLoader::LoadTypeHandleForTypeKey_Body + 0x73F (0x00007ff8`13cda38f)
      CORECLR! ClassLoader::LoadTypeHandleForTypeKey + 0x206 (0x00007ff8`13cd94e2)
      CORECLR! ClassLoader::LoadTypeDefThrowing + 0xC47 (0x00007ff8`13cd901f)
      CORECLR! ClassLoader::LoadTypeDefOrRefThrowing + 0x9AC (0x00007ff8`13cd8240)
      CORECLR! SigPointer::GetTypeHandleThrowing + 0xC4F (0x00007ff8`13e84f2b)
      CORECLR! ZapSig::DecodeType + 0x126 (0x00007ff8`13eff1fa)
      CORECLR! LoadDynamicInfoEntry + 0xC5F (0x00007ff8`13dbc9b7)
          File: F:\workspace\_work\1\s\src\coreclr\src\vm\crst.cpp Line: 765
          Image: C:\h\w\B1340951\p\CoreRun.exe
      
      
      Return code:      1
      Raw output file:      C:\h\w\B1340951\w\A8ED094C\e\Interop\COM\Reports\Interop.COM\NETClients\Events\NETClientEvents\NETClientEvents.output.txt
      Raw output:
      BEGIN EXECUTION
       "C:\h\w\B1340951\p\corerun.exe" NETClientEvents.dll 
      Validate_BasicCOMEvent...
      Expected: 100
      Actual: -1073740286
      END EXECUTION - FAILED
      FAILED
      Test Harness Exitcode is : 1
      To run the test:
      > set CORE_ROOT=C:\h\w\B1340951\p
      > C:\h\w\B1340951\w\A8ED094C\e\Interop\COM\NETClients\Events\NETClientEvents\NETClientEvents.cmd
      Expected: True
      Actual:   False
      Stack Trace:
        F:\workspace\_work\1\s\artifacts\tests\coreclr\windows.x64.Checked\TestWrappers\Interop.COM\Interop.COM.XUnitWrapper.cs(1437,0): at Interop_COM._NETClients_Events_NETClientEvents_NETClientEvents_._NETClients_Events_NETClientEvents_NETClientEvents_cmd()
      Output:
        
        Assert failure(PID 2304 [0x00000900], Thread: 644 [0x0284]): Consistency check failed: Crst Level violation: Can't take level 19 lock CrstPendingTypeLoadEntry because you already holding level 18 lock CrstInterop
        FAILED: false
        
        CORECLR! CHECK::Trigger + 0x2C9 (0x00007ff8`1432e079)
        CORECLR! CrstBase::IsSafeToTake + 0x3D8 (0x00007ff8`13d0c15c)
        CORECLR! CrstBase::Enter + 0x210 (0x00007ff8`13d0ba00)
        CORECLR! ClassLoader::LoadTypeHandleForTypeKey_Body + 0x73F (0x00007ff8`13cda38f)
        CORECLR! ClassLoader::LoadTypeHandleForTypeKey + 0x206 (0x00007ff8`13cd94e2)
        CORECLR! ClassLoader::LoadTypeDefThrowing + 0xC47 (0x00007ff8`13cd901f)
        CORECLR! ClassLoader::LoadTypeDefOrRefThrowing + 0x9AC (0x00007ff8`13cd8240)
        CORECLR! SigPointer::GetTypeHandleThrowing + 0xC4F (0x00007ff8`13e84f2b)
        CORECLR! ZapSig::DecodeType + 0x126 (0x00007ff8`13eff1fa)
        CORECLR! LoadDynamicInfoEntry + 0xC5F (0x00007ff8`13dbc9b7)
            File: F:\workspace\_work\1\s\src\coreclr\src\vm\crst.cpp Line: 765
            Image: C:\h\w\B1340951\p\CoreRun.exe
        

@jkotas
Copy link
Member

jkotas commented Nov 18, 2020

Failed in #44688

@AaronRobinsonMSFT
Copy link
Member

I was unable to reproduce this locally. I tried all the above tests using the various COMPlus_* settings with no luck. Therefore I added the correct dependency and generated a new header file.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Interop-coreclr blocking-clean-ci Blocking PR or rolling runs of 'runtime' or 'runtime-extra-platforms' bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants