Duplicate method in unhandled exception stacktrace
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
## Repro
1. Compile the following using `ilasm` (this is reduced test case for #121791):
```.assembly extern System.Runtime { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) }
.assembly test121791{}
.class public auto ansi test121791
extends [System.Runtime]System.Object
{
.method public hidebysig static int32
Main() cil managed
{
.entrypoint
.maxstack 1
call object test121791::M()
pop
ldc.i4 100
ret
}
.method private hidebysig static object
M() cil managed noinlining
{
.maxstack 8
IL_0000: ldsfld valuetype [System.Runtime]MissingType FieldOfMissingTypeInExistingAssembly::f
IL_0005: box [System.Runtime]MissingType
IL_000a: ret
}
}
.class private auto ansi beforefieldinit FieldOfMissingTypeInExistingAssembly
extends [System.Runtime]System.Object
{
.field public static valuetype [System.Runtime]MissingType f
}
```
2. Run it using `corerun test121791.exe`
## Actual result:
`M()` appears twice in the unhandled exception stacktrace:
```
C:\runtime\artifacts\bin\coreclr\windows.x64.Checked>corerun test121791.exe
Unhandled exception. System.TypeLoadException: Could not load type 'MissingType' from assembly 'System.Runtime, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
at test121791.M()
at test121791.M()
at test121791.Main()
```
## Expected result
`M()` appears just once in the unhandled exception stacktrace
Contributor guide
Assessment
This issue has not been assessed yet.