Skip to content

aspnetcore tests having Dynamic.Proxy fails on ppc64le architecture #93770

Description

@Sapana-Khemkar

Description

Around 6000+ aspnetcore tests which are using Dynamic.Proxy are failing on ppc64le with mono complier.

Reproduction Steps

build aspnetcore on ppc64le using cross built net8 rc2 and run tests.

Expected behavior

All tests should pass

Actual behavior

We get below error for 6000+ tests

Microsoft.AspNetCore.Server.Kestrel.Core.Tests.ConnectionContextTests.ParameterlessAbortCreateConnectionAbortedException
System.InvalidCastException : Specified cast is not valid.
at Castle.DynamicProxy.Internal.AttributeUtil.ReadAttributeValue(CustomAttributeTypedArgument argument)
at Castle.DynamicProxy.Internal.AttributeUtil.GetArguments(IList`1 constructorArguments, Type[]& constructorArgTypes, Object[]& constructorArgs)
at Castle.DynamicProxy.Internal.AttributeUtil.CreateInfo(CustomAttributeData attribute)
at Castle.DynamicProxy.Internal.AttributeUtil.GetNonInheritableAttributes(MemberInfo member)+MoveNext()
at System.Linq.Enumerable.SelectEnumerableIterator`2[[Castle.DynamicProxy.CustomAttributeInfo, Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc],[System.Reflection.Emit.CustomAttributeBuilder, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Castle.DynamicProxy.Generators.MetaProperty.BuildPropertyEmitter(ClassEmitter classEmitter)
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.ImplementProperty(ClassEmitter emitter, MetaProperty property, ProxyGenerationOptions options)
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.Generate(ClassEmitter class, ProxyGenerationOptions options)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.<>c__DisplayClass1_0.<GenerateCode>b__0(String n, INamingScope s)
at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options)
at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments)
at Moq.Mock`1[[Microsoft.AspNetCore.Connections.ConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].InitializeInstancePexProtected()
at Moq.PexProtector.Invoke(Action action)
at Moq.Mock`1[[Microsoft.AspNetCore.Connections.ConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].InitializeInstance()
at Moq.Mock`1[[Microsoft.AspNetCore.Connections.ConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].OnGetObject()
at Moq.Mock.get_Object()
at Moq.Mock`1[[Microsoft.AspNetCore.Connections.ConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].get_Object()
at Microsoft.AspNetCore.Server.Kestrel.Core.Tests.ConnectionContextTests.ParameterlessAbortCreateConnectionAbortedException() in /_/src/Servers/Kestrel/Core/test/ConnectionContextTests.cs:line 21
at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
0.0321365s✘ Microsoft.AspNetCore.Server.Kestrel.Core.Tests.ConnectionDispatcherTests.OnConnectionCreatesLogScopeWithConnectionId
System.InvalidCastException : Specified cast is not valid.
at Castle.DynamicProxy.Internal.AttributeUtil.ReadAttributeValue(CustomAttributeTypedArgument argument)
at Castle.DynamicProxy.Internal.AttributeUtil.GetArguments(IList`1 constructorArguments, Type[]& constructorArgTypes, Object[]& constructorArgs)
at Castle.DynamicProxy.Internal.AttributeUtil.CreateInfo(CustomAttributeData attribute)
at Castle.DynamicProxy.Internal.AttributeUtil.GetNonInheritableAttributes(MemberInfo member)+MoveNext()
at System.Linq.Enumerable.SelectEnumerableIterator`2[[Castle.DynamicProxy.CustomAttributeInfo, Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc],[System.Reflection.Emit.CustomAttributeBuilder, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
at Castle.DynamicProxy.Generators.MetaProperty.BuildPropertyEmitter(ClassEmitter classEmitter)
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.ImplementProperty(ClassEmitter emitter, MetaProperty property, ProxyGenerationOptions options)
at Castle.DynamicProxy.Contributors.CompositeTypeContributor.Generate(ClassEmitter class, ProxyGenerationOptions options)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.<>c__DisplayClass1_0.<GenerateCode>b__0(String n, INamingScope s)
at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory)
at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options)
at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments)
at Moq.Mock`1[[Microsoft.AspNetCore.Connections.DefaultConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].InitializeInstancePexProtected()
at Moq.PexProtector.Invoke(Action action)
at Moq.Mock`1[[Microsoft.AspNetCore.Connections.DefaultConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].InitializeInstance()
at Moq.Mock`1[[Microsoft.AspNetCore.Connections.DefaultConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].OnGetObject()
at Moq.Mock.get_Object()
at Moq.Mock`1[[Microsoft.AspNetCore.Connections.DefaultConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].get_Object()
at Microsoft.AspNetCore.Server.Kestrel.Core.Tests.ConnectionDispatcherTests.OnConnectionCreatesLogScopeWithConnectionId() in /_/src/Servers/Kestrel/Core/test/ConnectionDispatcherTests.cs:line 33
--- End of stack trace from previous location ---
Output:
| [0.007s] TestLifetime Information: Starting test OnConnectionCreatesLogScopeWithConnectionId at 2023-10-17T17:03:42
| [0.039s] Microsoft.AspNetCore.Server.Kestrel.Core.Tests.ConnectionDispatcherTests Error: Test threw an exception.
| System.InvalidCastException: Specified cast is not valid.
| at Castle.DynamicProxy.Internal.AttributeUtil.ReadAttributeValue(CustomAttributeTypedArgument argument)
| at Castle.DynamicProxy.Internal.AttributeUtil.GetArguments(IList`1 constructorArguments, Type[]& constructorArgTypes, Object[]& constructorArgs)
| at Castle.DynamicProxy.Internal.AttributeUtil.CreateInfo(CustomAttributeData attribute)
| at Castle.DynamicProxy.Internal.AttributeUtil.GetNonInheritableAttributes(MemberInfo member)+MoveNext()
| at System.Linq.Enumerable.SelectEnumerableIterator`2[[Castle.DynamicProxy.CustomAttributeInfo, Castle.Core, Version=4.0.0.0, Culture=neutral, PublicKeyToken=407dd0808d44fbdc],[System.Reflection.Emit.CustomAttributeBuilder, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].MoveNext()
| at Castle.DynamicProxy.Generators.MetaProperty.BuildPropertyEmitter(ClassEmitter classEmitter)
| at Castle.DynamicProxy.Contributors.CompositeTypeContributor.ImplementProperty(ClassEmitter emitter, MetaProperty property, ProxyGenerationOptions options)
| at Castle.DynamicProxy.Contributors.CompositeTypeContributor.Generate(ClassEmitter class, ProxyGenerationOptions options)
| at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateType(String name, Type[] interfaces, INamingScope namingScope)
| at Castle.DynamicProxy.Generators.ClassProxyGenerator.<>c__DisplayClass1_0.<GenerateCode>b__0(String n, INamingScope s)
| at Castle.DynamicProxy.Generators.BaseProxyGenerator.ObtainProxyType(CacheKey cacheKey, Func`3 factory)
| at Castle.DynamicProxy.Generators.ClassProxyGenerator.GenerateCode(Type[] interfaces, ProxyGenerationOptions options)
| at Castle.DynamicProxy.DefaultProxyBuilder.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
| at Castle.DynamicProxy.ProxyGenerator.CreateClassProxyType(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options)
| at Castle.DynamicProxy.ProxyGenerator.CreateClassProxy(Type classToProxy, Type[] additionalInterfacesToProxy, ProxyGenerationOptions options, Object[] constructorArguments, IInterceptor[] interceptors)
| at Moq.CastleProxyFactory.CreateProxy(Type mockType, IInterceptor interceptor, Type[] interfaces, Object[] arguments)
| at Moq.Mock`1[[Microsoft.AspNetCore.Connections.DefaultConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].InitializeInstancePexProtected()
| at Moq.PexProtector.Invoke(Action action)
| at Moq.Mock`1[[Microsoft.AspNetCore.Connections.DefaultConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].InitializeInstance()
| at Moq.Mock`1[[Microsoft.AspNetCore.Connections.DefaultConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].OnGetObject()
| at Moq.Mock.get_Object()
| at Moq.Mock`1[[Microsoft.AspNetCore.Connections.DefaultConnectionContext, Microsoft.AspNetCore.Connections.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]].get_Object()
| at Microsoft.AspNetCore.Server.Kestrel.Core.Tests.ConnectionDispatcherTests.OnConnectionCreatesLogScopeWithConnectionId() in /_/src/Servers/Kestrel/Core/test/ConnectionDispatcherTests.cs:line 33
| at Xunit.Sdk.TestInvoker`1.<>c__DisplayClass48_0.<<InvokeTestMethodAsync>b__1>d[[Xunit.Sdk.IXunitTestCase, xunit.core, Version=2.4.2.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c]].MoveNext() in /_/src/xunit.execution/Sdk/Frameworks/Runners/TestInvoker.cs:line 264
| --- End of stack trace from previous location ---
| at Xunit.Sdk.ExecutionTimer.AggregateAsync(Func`1 asyncAction) in /_/src/xunit.execution/Sdk/Frameworks/ExecutionTimer.cs:line 48
| at Xunit.Sdk.ExceptionAggregator.RunAsync(Func`1 code) in /_/src/xunit.core/Sdk/ExceptionAggregator.cs:line 90
| [0.055s] TestLifetime Information: Finished test OnConnectionCreatesLogScopeWithConnectionId in 0.0478395s

Regression?

No response

Known Workarounds

No response

Configuration

.NET 8 RC1 cross built for the linux-ppc64 target (using the Mono runtime by default).

dotnet --info
.NET SDK:
Version: 8.0.100-rc.2.23502.2
Commit: 0abacfc2b6
Runtime Environment:
OS Name: rhel
OS Version: 8
OS Platform: Linux
RID: linux-ppc64le
Base Path: /root/ashutosh/aspnetcore-crossbuild/aspnetcore/.dotnet/sdk/8.0.100-rc.2.23502.2/
.NET workloads installed:
There are no installed workloads to display.
Host:
Version: 8.0.0-rc.2.23479.6
Architecture: ppc64le
Commit: 0b25e38ad3
.NET SDKs installed:
8.0.100-rc.2.23502.2 [/root/ashutosh/aspnetcore-crossbuild/aspnetcore/.dotnet/sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 8.0.0-ci [/root/ashutosh/aspnetcore-crossbuild/aspnetcore/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0-rc.2.23480.2 [/root/ashutosh/aspnetcore-crossbuild/aspnetcore/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 8.0.0-rc.2.23479.6 [/root/ashutosh/aspnetcore-crossbuild/aspnetcore/.dotnet/shared/Microsoft.NETCore.App]
Other architectures found:
None
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download

Other information

No response

cc: @janani66@tmds@uweigand

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions