Open vikasgupta8 opened 9 months ago
Tagging @lambdageek
This looks like a duplicate of https://github.com/dotnet/runtime/issues/93770.
This looks like a duplicate of #93770.
Unfortunately not - running the aspnetcore tests uncovered a variety of different problems, one of those was addressed in #93770, two others were already spun off into separate issues (https://github.com/dotnet/runtime/issues/94488 and https://github.com/dotnet/runtime/issues/94490), and this issue is covering the last remaining problem in that area.
Also repros on linux-x64 with -p:UseMonoRuntime=true -p:SelfContained=true
Looks like ves_icall_System_Reflection_RuntimeCustomAttributeData_ResolveArgumentsInternal
doesn't do the correct encoding of custom attribute data for array types (or indeed any types, but particularly arrays) - it just encodes the value as an array object of the element values.
By contrast the corresponding core (I think... it's hard to follow) in CoreCLR recursively creates another struct (that will eventually become an array of CustomAttributeTypedArgument
)
/cc @SamMonoRT
Description
Aspnetcore tests are failing on ppc6le while testing cross build .net 8.0.100-rc.2.23502.2 mono build.
Stack trace:
Reproduction Steps
I have written sample program that reproduce the issue on ppc64le with mono .net8 rc2 When casting Value to
CustomAttributeTypedArgument
.Use the dotnet 8.0.100-rc.2.23502.2 cross build sdk.
Program.cs
This throws InvalidCastException on ppc6le(Mono) while works fine on intel x86(CoreClr).
Output on ppc64le (Mono)
Output on x86 intel (CoreClr)
Expected behavior
Aspnetcore tests should pass without any exception.
Actual behavior
Tests are failing with InvalidCastException
System.InvalidCastException: Specified cast is not valid.
Regression?
No response
Known Workarounds
If we update CastleCore version from 4.2.1 to 5.1.1 In aspnetcore/eng/Versions.props file then test failures observed in Microsoft.AspNetCore.Server.Kestrel.Core.Tests gets fixed.
Configuration
No response
Other information
CC: @uweigand @janani66 @Sapana-Khemkar