Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm][tests] NullReferenceException errors in System.Linq.Expressions.Tests #51708

Closed
radical opened this issue Apr 22, 2021 · 3 comments
Closed
Labels
arch-wasm WebAssembly architecture area-System.Linq.Expressions disabled-test The test is disabled in source code against the issue trimming-for-aot `EnableAggressiveTrimming=true` used for running tests with AOT
Milestone

Comments

@radical
Copy link
Member

radical commented Apr 22, 2021

Building with /p:EnableAggressiveTrimming=true fails with:

Build

/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(503,82): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c.<Property_GenericPropertyAccessor_ThrowsArgumentException>b__38_0(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(504,82): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c.<Property_GenericPropertyAccessor_ThrowsArgumentException>b__38_1(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(459,74): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c.<Property_InstanceProperty_NullExpression_ThrowsArgumentException>b__33_3(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(511,82): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c.<Property_PropertyAccessorNotFromProperty_ThrowsArgumentException>b__39_0(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(448,76): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c__DisplayClass32_0.<Property_StaticProperty_NonNullExpression_ThrowsArgumentException>b__2(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(472,76): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c__DisplayClass34_0.<Property_ExpressionNotReadable_ThrowsArgumentException>b__3(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(482,74): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c__DisplayClass35_0.<Property_ExpressionNotTypeOfDeclaringType_ThrowsArgumentException>b__2(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
@radical radical added arch-wasm WebAssembly architecture disabled-test The test is disabled in source code against the issue trimming-for-aot `EnableAggressiveTrimming=true` used for running tests with AOT labels Apr 22, 2021
@ghost
Copy link

ghost commented Apr 22, 2021

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

Building with /p:EnableAggressiveTrimming=true fails with:

Build

/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(503,82): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c.<Property_GenericPropertyAccessor_ThrowsArgumentException>b__38_0(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(504,82): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c.<Property_GenericPropertyAccessor_ThrowsArgumentException>b__38_1(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(459,74): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c.<Property_InstanceProperty_NullExpression_ThrowsArgumentException>b__33_3(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(511,82): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c.<Property_PropertyAccessorNotFromProperty_ThrowsArgumentException>b__39_0(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(448,76): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c__DisplayClass32_0.<Property_StaticProperty_NonNullExpression_ThrowsArgumentException>b__2(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(472,76): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c__DisplayClass34_0.<Property_ExpressionNotReadable_ThrowsArgumentException>b__3(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
/_/src/libraries/System.Linq.Expressions/tests/Member/MemberAccessTests.cs(482,74): Trim analysis error IL2103: System.Linq.Expressions.Tests.MemberAccessTests.<>c__DisplayClass35_0.<Property_ExpressionNotTypeOfDeclaringType_ThrowsArgumentException>b__2(): Value passed to the '#1' parameter of method 'System.Linq.Expressions.MemberExpression System.Linq.Expressions.Expression::Property(System.Linq.Expressions.Expression,System.Reflection.MethodInfo)' cannot be statically determined as a property accessor. [/__w/1/s/src/libraries/System.Linq.Expressions/tests/System.Linq.Expressions.Tests.csproj]
Author: radical
Assignees: -
Labels:

arch-wasm, disabled-test, trimming-for-aot

Milestone: -

@dotnet-issue-labeler dotnet-issue-labeler bot added area-System.Linq.Expressions untriaged New issue has not been triaged by the area owner labels Apr 22, 2021
@radical
Copy link
Member Author

radical commented Apr 22, 2021

cc @eerhardt

@ilonatommy
Copy link
Member

ilonatommy commented Jul 13, 2022

The error changed - I checked locally. Now we have 2 failures for /p:EnableAggressiveTrimming=true

[FAIL] System.Linq.Expressions.Tests.InterpreterTests.VerifyInstructions_Simple
System.NullReferenceException : Object reference not set to an instance of an object.
   at System.Linq.Expressions.Tests.InterpreterTests.GetInstructions(LambdaExpression expression)
   at System.Linq.Expressions.Tests.InterpreterTests.VerifyInstructions(LambdaExpression expression, String expected)
   at System.Linq.Expressions.Tests.InterpreterTests.VerifyInstructions_Simple()
   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
[FAIL] System.Linq.Expressions.Tests.InterpreterTests.VerifyInstructions_Exceptions
System.NullReferenceException : Object reference not set to an instance of an object.
   at System.Linq.Expressions.Tests.InterpreterTests.GetInstructions(LambdaExpression expression)
   at System.Linq.Expressions.Tests.InterpreterTests.VerifyInstructions(LambdaExpression expression, String expected)
   at System.Linq.Expressions.Tests.InterpreterTests.VerifyInstructions_Exceptions()
   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )

and 4 failures for /p:RunAOTCompilation=true /p:EnableAggressiveTrimming=true

[FAIL] System.Linq.Expressions.Tests.InterpreterTests.ConstructorThrows_StackTrace
Assert.Contains() Failure
Not found: Thrower..ctor
In value:     at System.Linq.Expressions.Interpreter.NewInstruction.Run(InterpretedFrame )
              at System.Linq.Expressions.Interpreter.LightLambda.Run(Object[] )
              at System.Dynamic.Utils.DelegateHelpers.FuncThunk[Thrower](Func`2 handler)
              at System.Linq.Expressions.Tests.InterpreterTests.AssertStackTrace(Action a, String searchTerm)
   at System.Linq.Expressions.Tests.InterpreterTests.AssertStackTrace(Action a, String searchTerm)
   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
[FAIL] System.Linq.Expressions.Tests.InterpreterTests.VerifyInstructions_Simple
System.NullReferenceException : Object reference not set to an instance of an object.
   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
[FAIL] System.Linq.Expressions.Tests.InterpreterTests.MethodThrows_StackTrace
Assert.Contains() Failure
Not found: Thrower.Foo
In value:     at System.Linq.Expressions.Interpreter.LightLambda.RunVoid(Object[] )
              at System.Dynamic.Utils.DelegateHelpers.ActionThunk1[Thrower](Func`2 handler, Thrower t1)
              at System.Linq.Expressions.Tests.InterpreterTests.AssertStackTrace(Action a, String searchTerm)
   at System.Linq.Expressions.Tests.InterpreterTests.AssertStackTrace(Action a, String searchTerm)
   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )
[FAIL] System.Linq.Expressions.Tests.InterpreterTests.VerifyInstructions_Exceptions
System.NullReferenceException : Object reference not set to an instance of an object.
   at System.Reflection.MethodInvoker.InterpretedInvoke(Object , Span`1 , BindingFlags )

@ilonatommy ilonatommy changed the title [wasm][tests] IL2103 trimming errors in System.Linq.Expressions.Tests [wasm][tests] NullReferenceException errors in System.Linq.Expressions.Tests Jul 13, 2022
@lewing lewing modified the milestones: 7.0.0, 8.0.0 Jul 25, 2022
@lewing lewing closed this as completed Jul 21, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Aug 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
arch-wasm WebAssembly architecture area-System.Linq.Expressions disabled-test The test is disabled in source code against the issue trimming-for-aot `EnableAggressiveTrimming=true` used for running tests with AOT
Projects
None yet
Development

No branches or pull requests

4 participants