Repository navigation
Assert fails (numGenericArgs > 0) when executing typeof(T) in a nonvirtual interface method, crossgen2. #37344
Copy link
Copy link
Closed
Description
Activity
- addeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jun 3, 2020 - changed the title
[-]Assert fails (numGenericArgs > 0), crossgen2, generic base class.[/-][+]Assert fails (numGenericArgs > 0) when executing typeof(T), crossgen2, generic base class.[/+]on Jun 3, 2020 - changed the title
[-]Assert fails (numGenericArgs > 0) when executing typeof(T), crossgen2, generic base class.[/-][+]Assert fails (numGenericArgs > 0) when executing typeof(T) in sealed function of generic base class, crossgen2.[/+]on Jun 3, 2020 More verbose backtrace:
#0 DBG_DebugBreak () at /home/sysop/dotnet-runtime/src/coreclr/src/pal/src/arch/amd64/debugbreak.S:10 No locals. #1 0x00007ffff635f4d1 in DebugBreak () at /home/sysop/dotnet-runtime/src/coreclr/src/pal/src/debug/debug.cpp:405 No locals. #2 0x00007ffff5af3e3b in DbgAssertDialog ( szFile=0x7ffff6543852 "/home/sysop/dotnet-runtime/src/coreclr/src/vm/prestub.cpp", iLine=2987, szExpr=0x7ffff65441bd "numGenericArgs > 0") at /home/sysop/dotnet-runtime/src/coreclr/src/utilcode/debug.cpp:698 szExprToDisplay = 0x7ffff65441bd "numGenericArgs > 0" fGotStackTrace = 1 fConstrained = 0 dwAssertStacktrace = 1 lAlreadyOwned = -1 #3 0x00007ffff5bfba36 in ProcessDynamicDictionaryLookup (pTransitionBlock=0x7fffffffd0b8, pModule=0x7fff7cf52418, pInfoModule=0x7fff7cf52418, kind=8 '\b', pBlob=0x7fff7cf816ef "\020\023", pBlobStart=0x7fff7cf816ee "\b\020\023", pResult=0x7fffffffccc8, pDictionaryIndexAndSlot=0x7fffffffcbc4) at /home/sysop/dotnet-runtime/src/coreclr/src/vm/prestub.cpp:2987 genericContextPtr = 140734468488216 numGenericArgs = 0 pContextMT = 0x7fff4c007c18 pContextMD = 0x0 signatureKind = ENCODE_NONE dictionarySlot = 21898 #4 0x00007ffff5bfc41c in DynamicHelperFixup (pTransitionBlock=0x7fffffffd0b8, pCell=0x7fff7cf81550, sectionIndex=2, pModule=0x7fff7cf52418, pKind=0x7fffffffcf74, pTH=0x7fffffffcf88, ppMD=0x7fffffffcf80, ppFD=0x7fffffffcf78) at /home/sysop/dotnet-runtime/src/coreclr/src/vm/prestub.cpp:3191 __alwayszero = false pNativeImage = 0x5555558a8b90 rva = 136528 pImportSection = 0x7fff7cf814a8 index = 0 pSignatures = 0x7fff7cf81608 pBlob = 0x7fff7cf816ef "\020\023" pBlobStart = 0x7fff7cf816ee "\b\020\023" kind = 8 '\b' pInfoModule = 0x7fff7cf52418 fReliable = false th = {{m_asTAddr = 0, m_asPtr = 0x0, m_asMT = 0x0, m_asTypeDesc = 0x0, m_asParamTypeDesc = 0x0, m_asTypeVarTypeDesc = 0x0, m_asFnPtrTypeDesc = 0x0}} pMD = 0x0 pFD = 0x0 genericLookup = {signature = 0x0, helper = CORINFO_HELP_RUNTIMEHANDLE_CLASS, indirections = 65535, testForNull = false, testForFixup = false, sizeOffset = 65535, offsets = {140737488342288, 140737316387501, 140737488342288, 93824994927264}, indirectFirstOffset = false, indirectSecondOffset = false} dictionaryIndexAndSlot = 4294967295 pHelper = 140735287693488 #5 0x00007ffff5bfddeb in DynamicHelperWorker (pTransitionBlock=0x7fffffffd0b8, pCell=0x7fff7cf81550, sectionIndex=2, pModule=0x7fff7cf52418, frameFlags=0) at /home/sysop/dotnet-runtime/src/coreclr/src/vm/prestub.cpp:3467 __gcHolder = {<GCHolderBase> = {m_Thread = 0x5555557e62a0, m_WasCoop = 1}, <No data fields>} th = {{m_asTAddr = 0, m_asPtr = 0x0, m_asMT = 0x0, m_asTypeDesc = 0x0, m_asParamTypeDesc = 0x0, m_asTypeVarTypeDesc = 0x0, m_asFnPtrTypeDesc = 0x0}} pMD = 0x0 pFD = 0x0 kind = ENCODE_NONE __pException = 0x1 CURRENT_THREAD = 0x5555557e62a0 CURRENT_THREAD_AVAILABLE = true __pUnCException = 0x0 __fExceptionCatched = false __pThread = 0x5555557e62a0 __pUnCEntryFrame = 0x7fffffffcff0 pHelper = 0 result = 0 __pThread = 0x5555557e62a0 CURRENT_THREAD = 0x5555557e62a0 CURRENT_THREAD_AVAILABLE = true frame = {m_gsCookie = 11150031900141442680, m_frame = {<FramedMethodFrame> = {<TransitionFrame> = {<Frame> = {<FrameBase> = { _vptr$FrameBase = 0x7ffff6bc2dd0 <vtable for DynamicHelperFrame+16>}, m_Next = 0xffffffffffffffff}, <No data fields>}, m_pTransitionBlock = 140737488343224, m_pMD = 0x0}, m_dynamicHelperFrameFlags = 0}} pFrame = 0x7fffffffcff0 exCopy = {static NoTargetFrameSp = 18446744073709551615, ExceptionPointers = {ExceptionRecord = 0x0, ContextRecord = 0x0}, TargetFrameSp = 18446744073709551615, RecordsOnStack = false} hasCaughtException = false ex = <error reading variable> #6 0x00007ffff5ec5c27 in DelayLoad_Helper () at /home/sysop/dotnet-runtime/src/coreclr/src/pal/inc/unixasmmacrosamd64.inc:837 No locals. #7 0x00007fff7cf70602 in test () No symbol table info available.- changed the title
[-]Assert fails (numGenericArgs > 0) when executing typeof(T) in sealed function of generic base class, crossgen2.[/-][+]Assert fails (numGenericArgs > 0) when executing typeof(T) in a nonvirtual interface method, crossgen2.[/+]on Jun 3, 2020 - removeduntriagedNew issue has not been triaged by the area ownerNew issue has not been triaged by the area owner
on Jun 3, 2020 debugged through why the call to test() is flagged as CORINFO_VIRTUALCALL_STUB rather than CORINFO_CALL. Its due to this check for Version Bubble equivalence between caller and target (VersionsWithMethodBody does contain Base<__Canon>.test(), but not Base.test()). Trying to determine whether this version bubble check needs to be updated.
should now be fixed.
- ghost locked as resolved and limited conversation to collaborators
on Dec 8, 2020
Description
Program containing call
sealedfunction from generic base class crashes with assertion (see below) when compiled with crossgen2. The issue isn't reproduces when compiling test application with crossgen1 or running not compiled version.Program crashes when executing
typeof(T)operator.Assertion is the following:
The issue is caused by presence of generic base class
Baseandsealedkeyword applied totestfuncion. Ifsealedkeyword commented out, the issue isn't reproduces.Source code of the test application:
Configuration
Situation repoduced on latest .NET version (commit e25517e) from
masterbranch.CoreCLR was build on x86 architecture in Debug mode. Issue is also reproducible, when CoreCLR is build in Checked mode. Also same or similar issue exists on ARM architecture: runtime crashes with segfault, no assertion message printed. But again, removing
sealedkeyword from test application "fixes" the issue.Other information
Backtrace is the following: