System.Reflection.Metadata.ApplyUpdateTest.TestAddInstanceField fails after roslyn update in hotreload-utils

Open
#116,624 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
csharp

Research direction

Start with the failing TestAddInstanceField case in src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs at line 389 and the AddInstanceField constructor in AddInstanceField.cs at line 42. Compare the Roslyn update from PR 115709 with the Mono interpreter path in RuntimeHelpers.Mono.cs at line 19, then run the test in the affected Mono cases. Done means the test passes and no longer needs to remain disabled for dependency flow.

Written by the indexing model from the issue text.

Description

area-Codegen-Interpreter-mono disabled-test

https://github.com/dotnet/runtime/pull/115709 updated roslyn in hotreload-utils and we started seeing this test failure in Mono interpreter cases:

Applying metadata update for /datadisks/disk1/work/C07B0A04/w/A82E08EE/e/System.Reflection.Metadata.ApplyUpdate.Test.AddInstanceField.dll, revision 1
[ERROR] FATAL UNHANDLED EXCEPTION: System.ArgumentException: Field not large enough to fill array (Parameter 'field_handle')
   at System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(Array array, RuntimeFieldHandle fldHandle) in /_/src/mono/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.Mono.cs:line 19
   at System.Reflection.Metadata.ApplyUpdate.Test.AddInstanceField..ctor() in /__w/1/s/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddInstanceField/AddInstanceField.cs:line 42
   at System.Reflection.Metadata.ApplyUpdateTest.<>c.<TestAddInstanceField>b__11_0() in /_/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs:line 389
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args) in /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs:line 22
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr) in /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs:line 57
--- End of stack trace from previous location ---
   at Microsoft.DotNet.RemoteExecutor.Program.Main(String[] args) in /_/src/arcade/src/Microsoft.DotNet.RemoteExecutor/src/Program.cs:line 97
Running test using RemoteExecutor
    System.Reflection.Metadata.ApplyUpdateTest.TestAddInstanceField [FAIL]
      Microsoft.DotNet.RemoteExecutor.RemoteExecutionException : Remote process failed with an unhandled exception.
      Stack Trace:
        
        Child exception:
          System.ArgumentException: Field not large enough to fill array (Parameter 'field_handle')
        /_/src/mono/System.Private.CoreLib/src/System/Runtime/CompilerServices/RuntimeHelpers.Mono.cs(19,0): at System.Runtime.CompilerServices.RuntimeHelpers.InitializeArray(Array array, RuntimeFieldHandle fldHandle)
        /__w/1/s/src/libraries/System.Runtime.Loader/tests/ApplyUpdate/System.Reflection.Metadata.ApplyUpdate.Test.AddInstanceField/AddInstanceField.cs(42,0): at System.Reflection.Metadata.ApplyUpdate.Test.AddInstanceField..ctor()
        /_/src/libraries/System.Runtime.Loader/tests/ApplyUpdateTest.cs(389,0): at System.Reflection.Metadata.ApplyUpdateTest.<>c.<TestAddInstanceField>b__11_0()
        /_/src/mono/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.Mono.cs(22,0): at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
        /_/src/libraries/System.Private.CoreLib/src/System/Reflection/MethodBaseInvoker.cs(57,0): at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
        
        Child process:
          System.Runtime.Loader.Tests, Version=10.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51 System.Reflection.Metadata.ApplyUpdateTest+<>c Void <TestAddInstanceField>b__11_0()

Disabled the test for now to unblock the dependency flow.

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.