Skip to content

[NativeAOT] Investigate esoteric failures in System.Linq.Expression.Tests #69944

Closed

Description

@LakshanF

The following tests need further investigation, creating a tracking issue for now, so as to enable the large number of tests in the meantime.

  1. MethodName_TypeArgsDontMatchConstraints_ThrowsArgumentException
Assert.Equal() Failure
 Expected: (null)
 Actual:   GenericArguments[0]
    at System.AssertExtensions.Throws[T](String, Func`1) + 0x3c
    at System.Linq.Expressions.Tests.CallTests.MethodName_TypeArgsDontMatchConstraints_ThrowsArgumentException() + 0x4f
    at System.Linq.Expressions.Tests!<BaseAddress>+0xb60f8e
    at System.InvokeUtils.CallDynamicInvokeMethod(Object, IntPtr, IntPtr, IntPtr, Object, Object[], BinderBundle, Boolean, Boolean) + 0x158
  1. GenericMethod
  System.Reflection.MissingRuntimeArtifactException : MakeGenericMethod() cannot create this generic method instantiation because no code was generated for it: 'System.Dynamic.Tests.InvokeMemberBindingTests.TestBaseClass.TellType<System.Int32>(System.Int32)'.
     at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x113

  1. Quote_RuntimeVariables_ClosureAndLocal
  System.Reflection.MissingRuntimeArtifactException : This object cannot be invoked because no code was generated for it: 'System.Func<System.Runtime.CompilerServices.IRuntimeVariables,System.Runtime.CompilerServices.IRuntimeVariables,System.Int32[],System.Runtime.CompilerServices.IRuntimeVariables>.Invoke(System.Runtime.CompilerServices.IRuntimeVariables,System.Runtime.CompilerServices.IRuntimeVariables,System.Int32[])'.
     at System.Reflection.Runtime.MethodInfos.RuntimeNamedMethodInfo`1.GetUncachedMethodInvoker(RuntimeTypeInfo[], MemberInfo) + 0x113
     at System.Reflection.Runtime.MethodInfos.RuntimeMethodInfo.get_MethodInvoker() + 0xa1
  1. VerifyMethodsCalledWithMakeGenericMethod

Activity

  1. ghost added
    untriaged
    on May 28, 2022
  2. MichalStrehovsky commented on May 30, 2022

    @MichalStrehovsky
    Member

    If you have the stack traces around, I could probably point in the right direction for fixing these.

    For example, if VerifyMethodsCalledWithMakeGenericMethod is failing with a NullReferenceException in the foreach, the fix is to put the 3 types listed here into RD.XML (or rewrite the code to make it trimming friendly - extract the foreach block below this into a separate method that has [DAM] on the type and call the method for each type individually instead of doing a foreach over an array):

    Assembly linqExpressions = typeof(Expression).Assembly;
    Type[] types = new Type[]
    {
    linqExpressions.GetType("System.Dynamic.Utils.DelegateHelpers"),
    linqExpressions.GetType("System.Dynamic.UpdateDelegates"),
    linqExpressions.GetType("System.Runtime.CompilerServices.CallSiteOps"),
    };

  3. removed
    untriaged
    on May 30, 2022
  4. added this to the 7.0.0 milestone on May 30, 2022
  5. added a commit that references this issue on Jul 13, 2022
    2875d77
  6. ghost added
    in-pr
    on Jul 13, 2022
  7. added a commit that references this issue on Jul 14, 2022
    7c4fa42
  8. ghost removed
    in-pr
    on Jul 14, 2022
  9. ghost locked as resolved and limited conversation to collaborators on Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions