Failing Mono test when `Assembly.GetCallingAssembly()` is used
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start with the open PR 115345, the AssemblyTests.GetCallingAssemblyInCctor failure, and the Mono call paths get_executing and get_caller_no_reflection in src/mono/mono/metadata/icall.c. Compare the interpreted and IL Emit invocation paths, then run the failing interpreter and Wasm tests; done means the expected calling assembly is returned in those configurations without regressing the other path.
Written by the indexing model from the issue text.
Description
This is a placeholder for now for the open PR https://github.com/dotnet/runtime/pull/115345. This PR changes invoke so that it always goes through the IL Emit path unlike previously where it will go through the interpreted (c++ runtime) path for the first call to each method. Thus there is likely an underlying bug that needs to be fixed to account for both cases.
Note that if the switch "Switch.System.Reflection.ForceInterpretedInvoke" is set, then the interpreted path is aways used. This is not the case for the failing test platforms.
Also, the test class has a namespace that starts with "System.Reflection" and that namespace is checked for in Mono to avoid reflection frames. See get_executing and get_caller_no_reflection which may or may not be related.
The test output for the failing interpreter and Wasm tests look like this:
[22:01:08] info: [FAIL] System.Reflection.Tests.AssemblyTests.GetCallingAssemblyInCctor
[22:01:08] info: Assert.Equal() Failure: Values differ
[22:01:08] info: Expected: System.Reflection.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51
[22:01:08] info: Actual: xunit.execution.dotnet, Version=2.9.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c
[22:01:08] info: at System.Reflection.Tests.AssemblyTests.TestGetCallingAssemblyInCctor.Run()
[22:01:08] info: at System.Object.InvokeStub_AssemblyTests.GetCallingAssemblyInCctor(IntPtr , Object )
[22:01:08] info: at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
Failing configurations:
net10.0-browser-Release-wasm-Mono_Release-WasmTestOnChrome-(Windows.Server2025.Amd64.Open)windows.server2025.a
net10.0-browser-Release-wasm-Mono_Release-WasmTestOnChrome-(Windows.Amd64.Server2022.Open)windows.amd64.serve
net10.0-linux-Debug-x64-Mono_Interpreter_Debug-Ubuntu.2204.Amd64.Open
net10.0-linux-Debug-x64-Mono_Interpreter_Debug-(Debian.13.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/do
net10.0-linux-Debug-x64-Mono_Interpreter_Debug-(Centos.10.Amd64.Open)Ubuntu.2204.Amd64.Open@mcr.microsoft.com/d
net10.0-browser-Release-wasm-Mono_Release-WasmTestOnFirefox-(Ubuntu.2204.Amd64)Ubuntu.2204.Amd64.Open@mcr.micro
net10.0-browser-Release-wasm-Mono_Release-WasmTestOnChrome-(Ubuntu.2204.Amd64)Ubuntu.2204.Amd64.Open@mcr.m
net10.0-browser-Release-wasm-Mono_Release-WasmTestOnChrome-(Ubuntu.2204.Amd64)Ubuntu.2204.Amd64.Open@mcr.mic
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from dotnet/runtime
-
agentic-workflows untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area-System.Reflection blocking-clean-ci-optional Known Build Error os-mac-os-x untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
area-CodeGen-coreclr untriaged
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
agentic-workflows untriaged
Difficulty 1/5 Under an hour Newbie friendliness 78/100
-
area-VM-meta-mono untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·
-
area/docs-content Bug pulumi/docs
Difficulty 1/5 1-3 hours Newbie friendliness 94/100
-
Create parent directories only after the containment check in InstallHelper.TryExtractToDirectory Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
PowerShell/PSResourceGet#2056 ·