Thanks to visit codestin.com
Credit goes to github.com

Skip to content

NullReferenceException in remoting when running xunit #8720

@bruno-garcia

Description

@bruno-garcia

Appologies if this is xUnit, or msbuild or .NET CLI or else but since it reproduces only with Mono on Linux and macOS, I'm raising it here.

Steps to Reproduce

  1. Checkout https://github.com/bruno-garcia/mono-xunit-issue
  2. dotnet test

Current Behavior

[xUnit.net 00:00:01.8591040] mono-xunit-issue: Catastrophic failure: System.NullReferenceException: Object reference not set to an instance of an object

Expected Behavior

Test pass (it passes on .NET Framework 4.7.2 and .NET Core 2.1rc (when I target netcoreapp2.0)

On which platforms did you notice this

[X] macOS
[X] Linux
[ ] Windows

Version Used:
On Ubuntu (WSL):
Mono JIT compiler version 5.12.0.226 (tarball Thu May 3 09:48:32 UTC 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
GC: sgen (concurrent by default)

On macOS:
Mono JIT compiler version 5.10.1.47 (2017-12/8eb8f7d5e74 Fri Apr 13 20:18:12 EDT 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: normal
SIGSEGV: altstack
Notification: kqueue
Architecture: amd64
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: yes(3.6.0svn-mono-master/8b1520c8aae)
GC: sgen (concurrent by default)

Stacktrace

Server stack trace:
  at System.Runtime.Remoting.ClientIdentity.get_ClientProxy () [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.RemotingServices.GetOrCreateClientIdentity (System.Runtime.Remoting.ObjRef objRef, System.Type proxyType, System.Object& clientProxy) [0x00068] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.RemotingServices.GetRemoteObject (System.Runtime.Remoting.ObjRef objRef, System.Type proxyType) [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.RemotingServices.GetProxyForRemoteObject (System.Runtime.Remoting.ObjRef objref, System.Type classToProxy) [0x0001b] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.RemotingServices.Unmarshal (System.Runtime.Remoting.ObjRef objectRef, System.Boolean fRefine) [0x0007a] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.RemotingServices.Unmarshal (System.Runtime.Remoting.ObjRef objectRef) [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.Messaging.CADMessageBase.UnmarshalArgument (System.Object arg, System.Collections.ArrayList args) [0x0003d] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.Messaging.CADMessageBase.UnmarshalArguments (System.Object[] arguments, System.Collections.ArrayList args) [0x00011] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.Messaging.CADMethodCallMessage.GetArgs (System.Collections.ArrayList args) [0x00000] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.Runtime.Remoting.Messaging.MethodCall..ctor (System.Runtime.Remoting.Messaging.CADMethodCallMessage msg) [0x0001e] in <71d8ad678db34313b7f718a414dfcb25>:0
  at System.AppDomain.ProcessMessageInDomain (System.Byte[] arrRequest, System.Runtime.Remoting.Messaging.CADMethodCallMessage cadMsg, System.Byte[]& arrResponse, System.Runtime.Remoting.Messaging.CADMethodReturnMessage& cadMrm) [0x00012] in <71d8ad678db34313b7f718a414dfcb25>:0
  at (wrapper remoting-invoke-with-check) System.AppDomain.ProcessMessageInDomain(byte[],System.Runtime.Remoting.Messaging.CADMethodCallMessage,byte[]&,System.Runtime.Remoting.Messaging.CADMethodReturnMessage&)
  at System.Runtime.Remoting.Channels.CrossAppDomainSink.ProcessMessageInDomain (System.Byte[] arrRequest, System.Runtime.Remoting.Messaging.CADMethodCallMessage cadMsg) [0x0000d] in <71d8ad678db34313b7f718a414dfcb25>:0

Exception rethrown at [0]:
  at (wrapper managed-to-native) System.Object.__icall_wrapper_mono_remoting_wrapper(intptr,intptr)
  at (wrapper remoting-invoke) Xunit.Sdk.TestFrameworkExecutor`1[Xunit.Sdk.IXunitTestCase].RunTests(System.Collections.Generic.IEnumerable`1<Xunit.Abstractions.ITestCase>,Xunit.Abstractions.IMessageSink,Xunit.Abstractions.ITestFrameworkExecutionOptions)
  at (wrapper xdomain-invoke) Xunit.Sdk.TestFrameworkExecutor`1[Xunit.Sdk.IXunitTestCase].RunTests(System.Collections.Generic.IEnumerable`1<Xunit.Abstractions.ITestCase>,Xunit.Abstractions.IMessageSink,Xunit.Abstractions.ITestFrameworkExecutionOptions)
  at Xunit.Xunit2.RunTests (System.Collections.Generic.IEnumerable`1[T] testCases, Xunit.Abstractions.IMessageSink messageSink, Xunit.Abstractions.ITestFrameworkExecutionOptions executionOptions) [0x0000e] in <76951d54e5564f89923967e66e39e57a>:0
  at Xunit.XunitFrontController.RunTests (System.Collections.Generic.IEnumerable`1[T] testMethods, Xunit.Abstractions.IMessageSink messageSink, Xunit.Abstractions.ITestFrameworkExecutionOptions executionOptions) [0x00006] in <76951d54e5564f89923967e66e39e57a>:0
  at TestFrameworkExtensions.RunTests (Xunit.Abstractions.ITestFrameworkExecutor executor, System.Collections.Generic.IEnumerable`1[T] testCases, Xunit.IMessageSinkWithTypes executionMessageSink, Xunit.Abstractions.ITestFrameworkExecutionOptions executionOptions) [0x00008] in <76951d54e5564f89923967e66e39e57a>:0
  at Xunit.Runner.VisualStudio.VsTestRunner.RunTestsInAssembly (Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.IRunContext runContext, Microsoft.VisualStudio.TestPlatform.ObjectModel.Adapter.IFrameworkHandle frameworkHandle, LoggerHelper logger, Xunit.Runner.VisualStudio.TestPlatformContext testPlatformContext, Xunit.IMessageSinkWithTypes reporterMessageHandler, Xunit.Runner.VisualStudio.AssemblyRunInfo runInfo) [0x00505] in <587845cbc5794887a177d25dc93c0b6a>:0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions