Repository navigation
Stack overflow in crossgen2 #70385
Description
Activity
- ghost addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jun 7, 2022 Reproduces on mine (m1 mac mini, macOS 12.3) as well:
Stack overflow. Assert failure(PID 26945 [0x00006941], Thread: 99227 [0x1839b]): Consistency check failed: FAILED: m_crawl.pFrame->IsTransitionToNativeFrame() File: /Users/egorbo/prj/runtime/src/coreclr/vm/stackwalk.cpp Line: 2274 Image: /Users/egorbo/prj/runtime/artifacts/bin/coreclr/OSX.arm64.Debug/crossgen2/osx-arm64/publish/crossgen2@dotnet/crossgen-contrib
Yep, I got both of these messages on different runs (
Consistency check failedfirst, followed by clean, and then I got the one in the original post).From what I see it happens only on "published" crossgen (even when it's invoked without arguments) - doesn't reproduce if I run it from sources via
dotnet runReacted by Filip NavaraI assume crossgen does not use NativeAOT on macos-arm64?
Reacted by Michal StrehovskýI believe that's what @agocke told me the last time, on OSX we don't use NativeAOT.
- removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jun 8, 2022 assume this repros only on
macOS 12.3and not earlier versions?assume this repros only on macOS 12.3 and not earlier versions?
I assume it reproduces on older versions too. In fact, 12.3 is not even the newest, I was just lazy to update.
I believe that's what @agocke told me the last time, on OSX we don't use NativeAOT.
Correct, this is R2R single-file.
I am seeing a somewhat similar problem on windows when using a recent SDK from dotnet/installer (
7.0.100-preview.6.22313.7) and replacing the bits with checked clrjit.dll, coreclr.dll and SPC.dll from a recent build. Ondotnet.exe new consoleI then hit the same stack overflow and assertion that @EgorBo wrote above.In debugger the stack trace looks like:
0:000> kn50 # Child-SP RetAddr Call Site 00 0000004c`1b676ff0 00007ffe`7259f4a8 coreclr!TypeKey::GetModule+0xa6 [C:\dev\dotnet\runtime\src\coreclr\vm\typekey.h @ 144] 01 0000004c`1b6770b0 00007ffe`725b311e coreclr!ClassLoader::ComputeLoaderModule+0xd8 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 205] 02 0000004c`1b6771a0 00007ffe`725b3aff coreclr!ClassLoader::LookupInLoaderModule+0x32e [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 1079] 03 0000004c`1b677330 00007ffe`725a918c coreclr!ClassLoader::LookupTypeHandleForTypeKey+0x31f [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 1116] 04 0000004c`1b6774a0 00007ffe`725aa4d8 coreclr!ClassLoader::LoadConstructedTypeThrowing+0xcec [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 954] 05 0000004c`1b677850 00007ffe`7270182a coreclr!ClassLoader::LoadGenericInstantiationThrowing+0x7e8 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 1683] 06 0000004c`1b677b20 00007ffe`72712a66 coreclr!MethodTable::InterfaceMapIterator::GetInterface+0x69a [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 8652] 07 0000004c`1b677dd0 00007ffe`726f76db coreclr!MethodTable::VerifyThatAllVirtualStaticMethodsAreImplemented+0x176 [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 8271] ------------------------------------------------------------- 08 0000004c`1b677f50 00007ffe`727bd3e3 coreclr!MethodTable::DoFullyLoad+0x143b [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 4697] 09 0000004c`1b678130 00007ffe`726f6b85 coreclr!TypeHandle::DoFullyLoad+0x173 [C:\dev\dotnet\runtime\src\coreclr\vm\typehandle.cpp @ 1212] 0a 0000004c`1b678200 00007ffe`727bd3e3 coreclr!MethodTable::DoFullyLoad+0x8e5 [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 4501] 0b 0000004c`1b6783e0 00007ffe`725b5724 coreclr!TypeHandle::DoFullyLoad+0x173 [C:\dev\dotnet\runtime\src\coreclr\vm\typehandle.cpp @ 1212] 0c 0000004c`1b6784b0 00007ffe`725aefc1 coreclr!PushFinalLevels+0x114 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 3186] 0d 0000004c`1b6785b0 00007ffe`725a942a coreclr!ClassLoader::LoadTypeHandleForTypeKey+0x251 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 3247] 0e 0000004c`1b678740 00007ffe`725aa4d8 coreclr!ClassLoader::LoadConstructedTypeThrowing+0xf8a [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 987] 0f 0000004c`1b678af0 00007ffe`7270182a coreclr!ClassLoader::LoadGenericInstantiationThrowing+0x7e8 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 1683] 10 0000004c`1b678dc0 00007ffe`726fa6c2 coreclr!MethodTable::InterfaceMapIterator::GetInterface+0x69a [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 8652] 11 0000004c`1b679070 00007ffe`7270f141 coreclr!MethodTable::FindDefaultInterfaceImplementation+0xe82 [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 5667] 12 0000004c`1b6795e0 00007ffe`72712eda coreclr!MethodTable::ResolveVirtualStaticMethod+0x821 [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 8080] 13 0000004c`1b6797f0 00007ffe`726f76db coreclr!MethodTable::VerifyThatAllVirtualStaticMethodsAreImplemented+0x5ea [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 8280] ------------------------------------------------------------- 14 0000004c`1b679970 00007ffe`727bd3e3 coreclr!MethodTable::DoFullyLoad+0x143b [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 4697] 15 0000004c`1b679b50 00007ffe`726f6b85 coreclr!TypeHandle::DoFullyLoad+0x173 [C:\dev\dotnet\runtime\src\coreclr\vm\typehandle.cpp @ 1212] 16 0000004c`1b679c20 00007ffe`727bd3e3 coreclr!MethodTable::DoFullyLoad+0x8e5 [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 4501] 17 0000004c`1b679e00 00007ffe`725b5724 coreclr!TypeHandle::DoFullyLoad+0x173 [C:\dev\dotnet\runtime\src\coreclr\vm\typehandle.cpp @ 1212] 18 0000004c`1b679ed0 00007ffe`725aefc1 coreclr!PushFinalLevels+0x114 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 3186] 19 0000004c`1b679fd0 00007ffe`725a942a coreclr!ClassLoader::LoadTypeHandleForTypeKey+0x251 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 3247] 1a 0000004c`1b67a160 00007ffe`725aa4d8 coreclr!ClassLoader::LoadConstructedTypeThrowing+0xf8a [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 987] 1b 0000004c`1b67a510 00007ffe`7270182a coreclr!ClassLoader::LoadGenericInstantiationThrowing+0x7e8 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 1683] 1c 0000004c`1b67a7e0 00007ffe`726fa6c2 coreclr!MethodTable::InterfaceMapIterator::GetInterface+0x69a [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 8652] 1d 0000004c`1b67aa90 00007ffe`7270f141 coreclr!MethodTable::FindDefaultInterfaceImplementation+0xe82 [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 5667] 1e 0000004c`1b67b000 00007ffe`72712eda coreclr!MethodTable::ResolveVirtualStaticMethod+0x821 [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 8080] 1f 0000004c`1b67b210 00007ffe`726f76db coreclr!MethodTable::VerifyThatAllVirtualStaticMethodsAreImplemented+0x5ea [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 8280] ------------------------------------------------------------- 20 0000004c`1b67b390 00007ffe`727bd3e3 coreclr!MethodTable::DoFullyLoad+0x143b [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 4697] 21 0000004c`1b67b570 00007ffe`726f6b85 coreclr!TypeHandle::DoFullyLoad+0x173 [C:\dev\dotnet\runtime\src\coreclr\vm\typehandle.cpp @ 1212] 22 0000004c`1b67b640 00007ffe`727bd3e3 coreclr!MethodTable::DoFullyLoad+0x8e5 [C:\dev\dotnet\runtime\src\coreclr\vm\methodtable.cpp @ 4501] 23 0000004c`1b67b820 00007ffe`725b5724 coreclr!TypeHandle::DoFullyLoad+0x173 [C:\dev\dotnet\runtime\src\coreclr\vm\typehandle.cpp @ 1212] 24 0000004c`1b67b8f0 00007ffe`725aefc1 coreclr!PushFinalLevels+0x114 [C:\dev\dotnet\runtime\src\coreclr\vm\clsload.cpp @ 3186]
It does not reproduce with #66887 reverted, though I hit other issues then so maybe the SDK just does not get to the problematic part. But cc @trylek anyway.
EDIT: After a fresh merge from main I no longer hit this problem, so maybe it is already resolved. The commit I was hitting the problem on was 2c110b6.
It does seem related to my change, I'll take a look, thanks Jakob for the heads-up.
Reacted by Jakob Botsch Nielsen- ghost addedin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
on Jun 22, 2022 - ghost removedin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
on Jun 22, 2022 - ghost locked as resolved and limited conversation to collaborators
on Jul 23, 2022
Tried this 3 times on a clean checkout (commit 08b3170) on macOS 12.3.1 (M1 ARM host):
./build.sh