You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate diagnosable failfast in GVM resolution (#78904)
If the program hits the conditions in #77070, generate a failfast message that makes it possible to create a workaround.
Instead of:
```
Process terminated. Generic virtual method pointer lookup failure.
Declaring type handle: MethodTable:0x00007FF66E8587B8
Target type handle: MethodTable:0x00007FF66E858810
Method name: Serialize
Instantiation:
Argument 00000000: MethodTable:0x00007FF66E85DA08
```
Generate:
```
Process terminated. Generic virtual method pointer lookup failure.
Declaring type handle: EETypeRva:0x005438B8(MemoryPackFormatter2`1[MemPackObject])
Target type handle: EETypeRva:0x00543910(MemoryPackableFormatter2`1[MemPackObject])
Method name: Serialize
Instantiation:
Argument 00000000: EETypeRva:0x00529B38(System.Buffers.ArrayBufferWriter`1[System.Byte])
```
The workaround is then:
```xml
<Directives>
<Application>
<Assembly Name="repro">
<Type Name="MemoryPackableFormatter2`1[[MemPackObject]]">
<Method Name="Serialize" Dynamic="Required All">
<GenericArgument Name="System.Buffers.ArrayBufferWriter`1[[System.Byte, mscorlib]],System.Memory" />
</Method>
</Type>
</Assembly>
</Application>
</Directives>
```
Copy file name to clipboardExpand all lines: src/coreclr/nativeaot/System.Private.TypeLoader/src/Internal/Runtime/TypeLoader/TypeLoaderEnvironment.GVMResolution.cs
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -72,13 +72,13 @@ public bool TryGetGenericVirtualTargetForTypeAndSlot(RuntimeTypeHandle targetHan
0 commit comments