Repository navigation
NativeAOT RC2 crash with GVMs on linux-x64 #77070
Copy link
Copy link
Closed
Labels
Milestone
Description
Output:
Process terminated. Generic virtual method pointer lookup failure.
Declaring type handle: MethodTable:0x00005608B8D60CF8
Target type handle: MethodTable:0x00005608B8DCE250
Method name: VisitDictionary
Instantiation:
Argument 00000000: MethodTable:0x00005608B8D79B30
backtrace
* thread #1, name = 'dnvm', stop reason = signal SIGABRT
* frame #0: 0x00007fde39ce1a7c libc.so.6`pthread_kill + 300
frame #1: 0x00007fde39c8d476 libc.so.6`raise + 22
frame #2: 0x00007fde39c737f3 libc.so.6`abort + 211
frame #3: 0x00005608b845b609 dnvm`SystemNative_Abort at pal_threading.c:286:5
frame #4: 0x00005608b85f8044 dnvm`S_P_CoreLib_System_RuntimeExceptionHelpers__FailFast_1 at RuntimeExceptionHelpers.cs:281
frame #5: 0x00005608b878fc2e dnvm`S_P_TypeLoader_Internal_Runtime_TypeLoader_TypeLoaderEnvironment__ResolveGenericVirtualMethodTarget_Static at TypeLoaderEnvironment.GVMResolution.cs:628
frame #6: 0x00005608b878e82f dnvm`S_P_TypeLoader_Internal_Runtime_TypeLoader_TypeLoaderEnvironment__TryGetGenericVirtualTargetForTypeAndSlot at TypeLoaderEnvironment.GVMResolution.cs:100
frame #7: 0x00005608b86c4aa5 dnvm`S_P_CoreLib_Internal_Runtime_CompilerServices_GenericVirtualMethodSupport__GVMLookupForSlotWorker at GenericVirtualMethodSupport.cs:31
frame #8: 0x00005608b86c4b5e dnvm`S_P_CoreLib_Internal_Runtime_CompilerServices_GenericVirtualMethodSupport__GVMLookupForSlotWorker at GenericVirtualMethodSupport.cs:47
frame #9: 0x00005608b86c4d52 dnvm`S_P_CoreLib_Internal_Runtime_CompilerServices_GenericVirtualMethodSupport__GVMLookupForSlot at GenericVirtualMethodSupport.cs:89
frame #10: 0x00005608b86e36a0 dnvm`S_P_CoreLib_System_Runtime_TypeLoaderExports___c___GVMLookupForSlot_b__14_0 at TypeLoaderExports.cs:144
frame #11: 0x00005608b8699e65 dnvm`S_P_CoreLib_System_Runtime_TypeLoaderExports__CacheMiss_0 at TypeLoaderExports.cs:218
frame #12: 0x00005608b8699d85 dnvm`S_P_CoreLib_System_Runtime_TypeLoaderExports__GVMLookupForSlot at TypeLoaderExports.cs:142
frame #13: 0x00005608b88ac7c5 dnvm`Serde_Serde_Json_JsonDeserializer__DeserializeDictionary<System___Canon__System___Canon> at JsonDeserializer.cs:94
frame #14: 0x00005608b887a06f dnvm`dnvm_Dnvm_Update_Release_SerdeVisitor__Serde_IDeserializeVisitor_Dnvm_Update_Release__VisitDictionary<Serde_Serde_Json_JsonDeserializer_DeDictionary> at Dnvm.Update.Release.IDeserialize.cs:33
Figuring out how to upload the exe and core dump
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
agocke commentedon Oct 15, 2022
core.zip
dnvm.zip
agocke commentedon Oct 20, 2022
I've got a minimal repro and some more info about this:
The problem appears to be something about static interface methods with generics. It looks like this is blowing up in the type loader, which doesn't know how to work with this method specification. I'm not sure what the fix is, but I'm still looking into it.
MichalStrehovsky commentedon Oct 27, 2022
Workaround is the following RD.XML (I constructed thing by looking up the symbols associated with the addresses in the FailFast) - it pregenerates the method dictionary we're failing to build at runtime:
I looked at this in a debugger myself and yep, this needs to be fixed in the type loader (we need to implement the missing dictionary kind that this is throwing about) and it is a hard fix:
We need to call into GVM resolution logic as part of type loading and build whatever GVM resolution logic came up with. Either that or generate something that will allow us to lazily resolve this once it's needed.
Touching anything in the type loader is pretty high risk. To set expectations, the fix might be too risky for servicing.
Allow struct visitors and use them for compound deserialize
Generate diagnosable failfast in GVM resolution
Generate diagnosable failfast in GVM resolution (#78904)
Generate diagnosable failfast in GVM resolution
Move all of generic virtual method resolution to the type loader
Move all of generic virtual method resolution to the type loader (#79925
Resolve generic virtual methods in managed type system (#80035)
Generate diagnosable failfast in GVM resolution (#78936)