New SIGABRT after upgrading to Mono 4 running NUnit tests - c#

We upgraded from Mono 3.12.0 to 4.0.1 the other day and now our NUnit tests crash with a SIGABRT and some other information. So far Google has been of no help and I'm running out of things to try (minus a rollback to 3.12.0). I was just hoping someone could maybe take a look and help me find a new avenue to explore!enter code here
I've tried the --shadowcopy switch, the --framework=v4.0/mono-4.0 switch, etc.
Console Output:
matt#matt-T420:~/bah3$ ~/Downloads/nunit3/bin/nunit-console.exe --
framework=mono-4.0 -v src/bin/Bah.Test.dll -test=Bah.Test.Unit
NUnit Console Runner 3.0.5562
Copyright (C) 2014 Charlie Poole
Test Files
src/bin/Bah.Test.dll
Runtime Environment
OS Version: Unix 3.19.0.16
CLR Version: 4.0.30319.17020
Options
ProcessModel: Default DomainUsage: Default
Execution Runtime: mono-4.0
Work Directory: /home/matt/bah
Internal Trace: Off
Selected test(s):
bah.Test.Unit
Agent process 29586 starting
Running under version 4.0.30319.17020, 4.0.1 (tarball Tue Apr 28 11:47:58 UTC 2015)
=> Bah.Test.Unit.ApplicationSourceTests.ToString
[ApplicationSource: Base=[Source: Base=[BahEntity: Key=[Key: Type=Bah.Core.SourceTypes.ApplicationSource, Name=a1], Name=a1], SourceType=Application], Command=command]
System.Type[] doesn't implement interface Castle.DynamicProxy.IInvocation
Stacktrace:
at <unknown> <0xffffffff>
at Moq.Proxy.CastleProxyFactory/CallContext.get_Method () <0x00021>
at Moq.HandleDestructor.HandleIntercept (Moq.Proxy.ICallContext,Moq.InterceptorContext,Moq.CurrentInterceptContext) <0x0001d>
at Moq.Interceptor.Intercept (Moq.Proxy.ICallContext) <0x000b0>
at Moq.Proxy.CastleProxyFactory/Interceptor.Intercept (Castle.DynamicProxy.IInvocation) <0x00085>
at Castle.DynamicProxy.AbstractInvocation.Proceed () <0x0023e>
at Castle.Proxies.IRepositoryProxy.Load<T, DTO> (Bah.Core.IKey,System.Func`2<DTO, T>) <0x001d3>
at Bah.Core.RepositoryExtensions.LoadContainer (Bah.Core.IRepository,Bah.Core.IKey) <0x000b0>
at Bah.Test.Unit.ContainerTest.TestContainerLoad () <0x00703>
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <0xffffffff>
at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Reflection.MonoMethod.InternalInvoke (System.Reflection.MonoMethod,object,object[],System.Exception&) <0xffffffff>
at System.Reflection.MonoMethod.Invoke (object,System.Reflection.BindingFlags,System.Reflection.Binder,object[],System.Globalization.CultureInfo) <0x000f7>
at System.Reflection.MethodBase.Invoke (object,object[]) <0x0002a>
at NUnit.Core.Reflect.InvokeMethod (System.Reflection.MethodInfo,object,object[]) <0x0004f>
at NUnit.Core.TestMethod.RunTestMethod () <0x00053>
at NUnit.Core.TestMethod.RunTestCase (NUnit.Core.TestResult) <0x00027>
at NUnit.Core.TestMethod.RunTest () <0x0012f>
at NUnit.Core.NUnitTestMethod.RunTest () <0x0000f>
at NUnit.Core.TestMethod.RunRepeatedTest () <0x000c3>
at NUnit.Core.TestMethod.RunTestInContext () <0x00627>
at NUnit.Core.TestMethod.Run (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x000b3>
at NUnit.Core.TestSuite.RunAllTests (NUnit.Core.TestResult,NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00291>
at NUnit.Core.TestSuite.RunSuite (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x0049b>
at NUnit.Core.TestSuite.RunSuiteInContext (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00087>
at NUnit.Core.TestSuite.Run (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00083>
at NUnit.Core.TestFixture.Run (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00087>
at NUnit.Core.TestSuite.RunAllTests (NUnit.Core.TestResult,NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00291>
at NUnit.Core.TestSuite.RunSuite (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x0049b>
at NUnit.Core.TestSuite.RunSuiteInContext (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00087>
at NUnit.Core.TestSuite.Run (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00083>
at NUnit.Core.TestSuite.RunAllTests (NUnit.Core.TestResult,NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00291>
at NUnit.Core.TestSuite.RunSuite (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x0049b>
at NUnit.Core.TestSuite.RunSuiteInContext (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00087>
at NUnit.Core.TestSuite.Run (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00083>
at NUnit.Core.TestSuite.RunAllTests (NUnit.Core.TestResult,NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00291>
at NUnit.Core.TestSuite.RunSuite (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x0049b>
at NUnit.Core.TestSuite.RunSuiteInContext (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00087>
at NUnit.Core.TestSuite.Run (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00083>
at NUnit.Core.TestSuite.RunAllTests (NUnit.Core.TestResult,NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00291>
at NUnit.Core.TestSuite.RunSuite (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x0049b>
at NUnit.Core.TestSuite.RunSuiteInContext (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00087>
at NUnit.Core.TestSuite.Run (NUnit.Core.EventListener,NUnit.Core.ITestFilter) <0x00083>
at NUnit.Core.SimpleTestRunner.Run (NUnit.Core.EventListener,NUnit.Core.ITestFilter,bool,NUnit.Core.LoggingThreshold) <0x00130>
at NUnit.Core.TestRunnerThread.TestRunnerThreadProc () <0x00065>
at System.Threading.Thread.StartInternal () <0x00071>
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) <0xffffffff>
Native stacktrace:
/usr/bin/mono() [0x4b1d6c]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x10d10) [0x7f18fd533d10]
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0x37) [0x7f18fd18e267]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x16a) [0x7f18fd18feca]
/usr/bin/mono() [0x629079]
/usr/bin/mono() [0x629287]
/usr/bin/mono() [0x629332]
/usr/bin/mono() [0x4b3d8f]
/usr/bin/mono() [0x4b45a3]
[0x40e62046]
Debug info from gdb:
Could not attach to process. If your uid matches the uid of the target
process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try
again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf
ptrace: Operation not permitted.
No threads.
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
System.Runtime.Remoting.RemotingException: Connection refused
Server stack trace:
at System.Runtime.Remoting.Channels.Tcp.HostConnectionPool.CreateConnection () [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Channels.Tcp.HostConnectionPool.GetConnection () [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool.GetConnection (System.String host, Int32 port) [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage (IMessage msg, ITransportHeaders requestHeaders, System.IO.Stream requestStream, ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage (IMessage msg) [0x00000] in <filename unknown>:0
Exception rethrown at [0]:
at System.Runtime.Remoting.Channels.Tcp.HostConnectionPool.CreateConnection () [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Channels.Tcp.HostConnectionPool.GetConnection () [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Channels.Tcp.TcpConnectionPool.GetConnection (System.String host, Int32 port) [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Channels.Tcp.TcpClientTransportSink.ProcessMessage (IMessage msg, ITransportHeaders requestHeaders, System.IO.Stream requestStream, ITransportHeaders& responseHeaders, System.IO.Stream& responseStream) [0x00000] in <filename unknown>:0
at System.Runtime.Remoting.Channels.BinaryClientFormatterSink.SyncProcessMessage (IMessage msg) [0x00000] in <filename unknown>:0

Related

Phantom errors Xamarin Forms Android

I have a physical device connected. When the phone is locked and I deploy the application after unlocking, the application works and everything is fine. But if the screen is unlocked and I deploy I get the following error. In this case, everything is ok on the emulator. Help me understand this nonsense.
**System.NullReferenceException:** 'Object reference not set to an instance of an object.'
[HotReload] (2021-03-17 23:08:35.2): INFO: Инициализация горячей перезагрузки XAML…
[HotReload] (2021-03-17 23:08:35.2): WARN: (DriverHelper v 2.0.Android) Unknown Breakpoint Hit: Android.Runtime.JNIEnv.RegisterJniNatives( typeName_ptr, int typeName_len, jniClass, methods_ptr, int methods_len)
"<unnamed thread>" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Diagnostics.Debugger.Mono_UnhandledException_internal (System.Exception) <0x00007>
at System.Diagnostics.Debugger.Mono_UnhandledException (System.Exception) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:125
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.46 (intptr,intptr) [0x00020] in <44e54a86dea24313a2bdb807df77c27a>:0
at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.46 (intptr,intptr) [0x00033] in <44e54a86dea24313a2bdb807df77c27a>:0
"ProtocolHandler.SendThread" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler/WaitableActionsList.WaitForData () [0x00019] in <c37c1589af144356b99fb170c5e22242>:0
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ActionThread (object) [0x00045] in <c37c1589af
144356b99fb170c5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00025] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:78
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/
03-17 23:08:49.317 E/mono (27416): Full thread dump:referencesource/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart (object) [0x0000f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:93
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) [0x0006b] in <c72658f647bc485bbfb8c9fcaa790862>:0
"<threadpool thread>"
"Debugger agent"
"Thread Pool Worker"
"Thread Pool Worker"
"Thread Pool Worker"
"Timer-Scheduler"
"Finalizer"
"ProtocolHandler.ProcessThread" at <unknown> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android
/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler/WaitableActionsList.WaitForData () [0x00019] in <c37c1589af144356b99fb170c5e22242>:0
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ActionThread (object) [0x00045] in <c37c1589af144356b99fb170c5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00025] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:78
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/re
ferencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart (object) [0x0000f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:93
at (wrapper runtime-invoke) <Module>.runtime_invoke_void__this___object (object,intptr,intptr,intptr) [0x0006b] in <c72658f647bc485bbfb8c9fcaa790862>:0
"ProtocolHandler.ReadThread" at <unknow
n> <0xffffffff>
at (wrapper managed-to-native) System.Threading.Monitor.Monitor_wait (object,int) <0x00007>
at System.Threading.Monitor.ObjWait (bool,int,object) [0x0002f] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/corlib/System.Threading/Monitor.cs:85
at System.Threading.Monitor.Wait (object,int,bool) [0x0000e] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:218
at System.Threading.Monitor.Wait (object) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/monitor.cs:238
at Xamarin.HotReload.HotReloadAgent.Microsoft.VisualStudio.DesignTools.TapContract.Networking.IDataBridge.ReadMessage () [0x0002f] in D:\a\1\s\Source\Xamarin.HotReload.Agent\HotReloadAgent.cs:341
at Microsoft.VisualStudio.DesignTools.TapContract.Networking.ProtocolHandler.ReadThread () [0x00038] in <c37c1589af144356b99fb170c
5e22242>:0
at System.Threading.ThreadHelper.ThreadStart_Context (object) [0x00014] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:74
at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00071] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:968
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object,bool) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/executioncontext.cs:910
at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext,System.Threading.ContextCallback,object) [0x0002b] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource
/mscorlib/system/threading/executioncontext.cs:899
at System.Threading.ThreadHelper.ThreadStart () [0x00008] in /Users/builder/jenkins/workspace/archive-mono/2020-02/android/release/mcs/class/referencesource/mscorlib/system/threading/thread.cs:111
at (wrapper runtime-invoke) object.runtime_invoke_void__this__ (object,intptr,intptr,intptr) [0x00067] in <c72658f647bc485bbfb8c9fcaa790862>:0

Mono IPv4 versus IPv6 issues: SocketException: Invalid arguments

I have a Mono .NET application that uses ppatierno.AzureSBLite to receive data from an Azure ServiceBus.
The code is straightforward:
var factory = MessagingFactory.CreateFromConnectionString(connectionString);
var client = factory.CreateEventHubClient(eventHubEntity);
var group = client.GetDefaultConsumerGroup();
var receiver = group.CreateReceiver(partitionId, startingDateTimeUtc);
EventData = receiver.Receive();
On my VM running 64-bit Ubuntu 16.04, using Ubuntu's Mono packages, it works flawlessly.
On my build server running Ubuntu 14.04, in a 64-bit 16.04 chroot (so the chroot environment should have all of the same userland packages as the VM), using Ubuntu's Mono packages, I get the following error:
System.Net.Sockets.SocketException: Invalid arguments
at System.Net.Sockets.Socket.BeginMConnect (System.Net.Sockets.SocketAsyncResult sockares) <0x41029e20 + 0x001df> in <filename unknown>:0
at System.Net.Sockets.Socket.BeginConnect (System.Net.IPAddress[] addresses, Int32 port, System.AsyncCallback callback, System.Object state) <0x41029720 + 0x00107> in <filename unknown>:0
at System.Net.Sockets.Socket.BeginConnect (System.String host, Int32 port, System.AsyncCallback callback, System.Object state) <0x41027720 + 0x0008f> in <filename unknown>:0
at Amqp.TcpTransport+<>c__DisplayClass3.<ConnectAsync>b__0 (System.AsyncCallback c, System.Object s) <0x41027670 + 0x00073> in <filename unknown>:0
at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncImpl (System.Func`3 beginMethod, System.Func`2 endFunction, System.Action`1 endAction, System.Object state, TaskCreationOptions creationOptions) <0x7fc54c2c8700 + 0x001cf> 24334 in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x7fc54c0016d0 + 0x00029> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x7fc54bfff6b0 + 0x000a7> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x7fc54bfff630 + 0x0006b> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x7fc54bfff5e0 + 0x0003a> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.GetResult () <0x7fc54bfff5c0 + 0x00012> in <filename unknown>:0
at Amqp.TcpTransport.Connect (Amqp.Connection connection, Amqp.Address address, Boolean noVerification) <0x410219b0 + 0x0015e> in <filename unknown>:0
at Amqp.Connection.Connect (Amqp.Sasl.SaslProfile saslProfile, Amqp.Framing.Open open) <0x41021680 + 0x0006b> in <filename unknown>:0
at Amqp.Connection..ctor (Amqp.Address address, Amqp.Sasl.SaslProfile saslProfile, Amqp.Framing.Open open, Amqp.OnOpened onOpened) <0x4101ba40 + 0x00227> in <filename unknown>:0
at Amqp.Connection..ctor (Amqp.Address address) <0x4101b9b0 + 0x0001b> in <filename unknown>:0
at ppatierno.AzureSBLite.Messaging.Amqp.AmqpMessagingFactory.Open (System.String entity) <0x4101b760 + 0x001b7> in <filename unknown>:0
at ppatierno.AzureSBLite.Messaging.Amqp.AmqpMessageReceiver.ReceiveEventData () <0x4101afb0 + 0x00042> in <filename unknown>:0
at ppatierno.AzureSBLite.Messaging.EventHubReceiver.Receive () <0x4101ab40 + 0x0001f> in <filename unknown>:0
at ReceiveEdgeData.EdgeReceiver.MainLoop () <0x4101a920 + 0x0004b> in <filename unknown>:0
If I understand the strace output correctly, the non-functioning host is creating an IPv6 socket and trying to directly connect to an IPv4 address:
connect(4, {sa_family=AF_INET, sin_port=htons(5671), sin_addr=inet_addr("52.176.47.198")}, 16) = -1 EINVAL (Invalid argument)
While the functioning host is using something like dual-mode sockets to correctly represent the IPv4 address as an IPv6 address:
connect(4, {sa_family=AF_INET6, sin6_port=htons(5671), inet_pton(AF_INET6, "::ffff:52.176.47.198", &sin6_addr), sin6_flowinfo=htonl(0), sin6_scope_id=0}, 28) = -1 EINPROGRESS (Operation now in progress)
Given that this is happening somewhere inside Mono and its dependencies, how do I troubleshoot and fix this?

SignalR run with Mono and apache: HTTP 500 error (in SignalR code)

I've been running SignalR on mono with both self-hosting on localhost and on IIS.
But self-hosting with mono on a server didn't work yet
The full error I get on the webpage is:
System.InvalidOperationException
Operation is not valid due to the current state of the object.
Description:` HTTP 500.Error processing request.
Details: Non-web exception. Exception origin (name of application or object): Microsoft.Owin.Host.SystemWeb.
Exception stack trace:
at Microsoft.Owin.Host.SystemWeb.IntegratedPipeline.IntegratedPipelineContextStage.BeginEvent (System.Object sender, System.EventArgs e, System.AsyncCallback cb, System.Object extradata) <0x404788f0 + 0x0074b> in <filename unknown>:0
at System.Web.HttpApplication+<RunHooks>c__Iterator0.MoveNext () <0x404715e0 + 0x00367> in <filename unknown>:0
at System.Web.HttpApplication+<Pipeline>c__Iterator1.MoveNext () <0x40468000 + 0x01a65> in <filename unknown>:0
at System.Web.HttpApplication.Tick () <0x40465950 + 0x00057> in <filename unknown>:0
In the Apache error log:
Cannot access a closed Stream.
at System.IO.MemoryStream.Write (System.Byte[] buffer, Int32 offset, Int32 count) <0x4006e720 + 0x0008b> in <filename unknown>:0
at System.IO.BinaryWriter.Write (Int32 value) <0x4006e660 + 0x00087> in <filename unknown>:0
at Mono.WebServer.ModMonoRequest.IsConnected () <0x40540670 + 0x0001f> in <filename unknown>:0
at Mono.WebServer.Apache.ModMonoWorker.IsConnected () <0x40540640 + 0x0001b> in <filename unknown>:0
at Mono.WebServer.ModMonoWorkerRequest.IsClientConnected () <0x405405b0 + 0x00030> in <filename unknown>:0
at System.Web.HttpResponse.get_IsClientConnected () <0x40540570 + 0x0002a> in <filename unknown>:0
at System.Web.HttpResponseWrapper.get_IsClientConnected () <0x40540540 + 0x0001b> in <filename unknown>:0
at Microsoft.Owin.Host.SystemWeb.OwinCallContext.CheckIsClientConnected (System.Object obj) <0x40540490 + 0x00051> in <filename unknown>:0
at System.Threading.Timer+Scheduler.TimerCB (System.Object o) <0x4053daf0 + 0x001a7> in <filename unknown>:0
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () <0x403d3c60 + 0x0002f> in <filename unknown>:0
at System.Threading.ThreadPoolWorkQueue.Dispatch () <0x403d09b0 + 0x0021a> in <filename unknown>:0
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () <0x403d0980 + 0x00010> in <filename unknown>:0
My code looks just fine, my program.cs contains:
class Program
{
static void Main(string[] args)
{
string url = "http://*:80";
using (Microsoft.Owin.Hosting.WebApp.Start<Startup>(url))
{
}
}
}
I have no idea what to do, should I look to change something in my code to let it work with mono?
I'm going to use SignalR Core, problem solved! :)

Xamarin.UITest REPL connection refused

I'm beginning UI automated testing with Xamarin.UITest in Xamarin Studio. I'm using the basic CreditCardValidator project given by Xamarin. My tests work as expected, but when I try to add the line app.Repl(); to query the UI and enter the tree command (or any other for that matter), I keep getting the error:
App has been initialized to the 'app' variable.
Exit REPL with ctrl-c or see help for more commands.
>>> tree
Execution failed with exception: System.Net.WebException: Error:
ConnectFailure (Connection refused) ---> System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.Socket.Connect (System.Net.EndPoint remoteEP) <0x3acc998 + 0x0017b> in <filename unknown>:0
at System.Net.WebConnection.Connect (System.Net.HttpWebRequest request) <0x3aca8f8 + 0x004b7> in <filename unknown>:0
--- End of inner exception stack trace ---
at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) <0x3acdbe8 + 0x00187> in <filename unknown>:0
at System.Threading.Tasks.TaskFactory`1[TResult].FromAsyncCoreLogic (IAsyncResult iar, System.Func`2 endFunction, System.Action`1 endAction, System.Threading.Tasks.Task`1 promise, Boolean requiresSynchronization) <0x1944280 + 0x00069> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x18aa010 + 0x00035> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess (System.Threading.Tasks.Task task) <0x18a7830 + 0x000b7> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (System.Threading.Tasks.Task task) <0x18a7790 + 0x00087> in <filename unknown>:0
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (System.Threading.Tasks.Task task) <0x18a7740 + 0x0003f> in <filename unknown>:0
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter[TResult].GetResult () <0x18a8040 + 0x00024> in <filename unknown>:0
at System.Net.Http.HttpClientHandler+<SendAsync>c__async0.MoveNext () <0x3abbe30 + 0x00df3> in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
at Xamarin.UITest.Shared.Http.HttpClient.Request (System.String method, System.String endpoint, ExceptionPolicy exceptionPolicy, Nullable`1 timeOut) <0x3aadc68 + 0x0040f> in <filename unknown>:0
at Xamarin.UITest.Shared.Http.HttpClient.Get (System.String endpoint, ExceptionPolicy exceptionPolicy, Nullable`1 timeOut) <0x3aadc18 + 0x0003b> in <filename unknown>:0
at Xamarin.UITest.Android.AndroidGestures.Dump () <0x3aadb18 + 0x00053> in <filename unknown>:0
at Xamarin.UITest.Utils.TreePrintHelper.PrintTree (ITreePrinter treePrinter) <0x3aada28 + 0x0002a> in <filename unknown>:0
at Xamarin.UITest.Queries.AppPrintHelper.Tree (Nullable`1 console) <0x3aad950 + 0x0008b> in <filename unknown>:0
at <InteractiveExpressionClass>.Host (System.Object& $retval) <0x3aad830 + 0x00047> in <filename unknown>:0
at Mono.CSharp.Evaluator.Evaluate (System.String input, System.Object& result, System.Boolean& result_set) <0x2ede1b0 + 0x0008f> in <filename unknown>:0
at Xamarin.UITest.Repl.Evaluation.MonoCSharpReplEngine.Evaluate (System.String line) <0x2ede0a0 + 0x00057> in <filename unknown>:0
at Xamarin.UITest.Repl.Repl.ReplFacade.RunCode (System.String code) <0x2edde88 + 0x00063> in <filename unknown>:0
at Xamarin.UITest.Repl.PromptHandler.PrintTree () <0x3aa4e50 + 0x0001f> in <filename unknown>:0
at Xamarin.UITest.Repl.PromptHandler.HandleInput (ConsoleKeyInfo key) <0x3a38520 + 0x001da> in <filename unknown>:0
at Xamarin.UITest.Repl.Program.Main (System.String[] args) <0x71def8 + 0x003ef> in <filename unknown>:0
Press any key to exit.
I have added the INTERNET permission in the app and the tests, themselves, run fine. The code for the tests is:
public class RecorderTest
{
public IApp app;
[SetUp]
public void Setup()
{
app = ConfigureApp.Android.Debug().ApkFile(<path/to/apk/>).StartApp();
}
[Test]
public void CreditCardNumberTooShortError()
{
//app.Repl();
app.Tap(x => x.Id("creditCardNumberText"));
app.Screenshot("Tapped on view with class: AppCompatEditText");
app.EnterText(x => x.Id("creditCardNumberText"), "1234");
app.Tap(x => x.Id("validateButton"));
app.Screenshot("Tapped on view with class: AppCompatButton");
AppResult[] result = app.Query(c => c.Class("AppCompatTextView").Text("Credit card number is too short."));
Assert.IsTrue(result.Any(), "The error message is not being displayed");
}
[Test]
public void CreditCardNumberTooLongError()
{
app.Repl();
app.EnterText(x => x.Marked("creditCardNumberText"), new String('9', 17));
app.Screenshot("Entered Credit card number");
app.Tap(x => x.Id("validateButton"));
app.Screenshot("Tapped on view with class: AppCompatButton");
AppResult[] result = app.Query(c => c.Id("errorMessagesText").Text("Credit card number is too long."));
Assert.IsTrue(result.Any(), "The error message is not being displayed");
}
}
I've used the Calabash Framework by Xamarin as well and I can use the console command and query the app just fine. Not sure whey this isn't working with Xamarin.UITest.
I'm running Java 1.7, NUnit 2.6.3 and Xamarin Studio 6.0.1 (build 9)

Using Realm in Xamarin.Android app running in emulator throws RealmFileAccessErrorException

I'm trying to add Realm to my app (Xamarin Android). Starting with emulator first (Xaamrin android player - Nexus 5 with Android Lollipop).
Github Issue here
My code:
protected override async void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);
SetContentView(Resource.Layout.MyActivitylayout);
....
try
{
var path = AndroidIoHelper.CreateFileInAppFolder(AndroidIoHelper.GetAppDataFolder(), "tlm_db", "realm");
var realm = Realm.GetInstance(path);
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
.......
}
Exception I'm getting:
Realms.RealmFileAccessErrorException: Operation not permitted at
Realms.NativeCommon.ExceptionThrower (IntPtr exceptionCode, IntPtr
utf8String, IntPtr stringLen) [0x0003b] in :0 at
(wrapper native-to-managed) Realms.NativeCommon:ExceptionThrower
(intptr,intptr,intptr) at (wrapper managed-to-native)
Realms.NativeSharedRealm:open
(Realms.SchemaHandle,string,intptr,intptr,intptr,byte[],ulong) 05-15
12:57:18.384 I/mono-stdout( 5250):
Realms.RealmFileAccessErrorException: Operation not permitted 05-15
12:57:18.384 I/mono-stdout( 5250): at
Realms.NativeCommon.ExceptionThrower (IntPtr exceptionCode, IntPtr
utf8String, IntPtr stringLen) [0x0003b] in :0 05-15
12:57:18.384 I/mono-stdout( 5250): at (wrapper native-to-managed)
Realms.NativeCommon:ExceptionThrower (intptr,intptr,intptr) 05-15
12:57:18.385 I/mono-stdout( 5250): at (wrapper managed-to-native)
Realms.NativeSharedRealm:open
(Realms.SchemaHandle,string,intptr,intptr,intptr,byte[],ulong) 05-15
12:57:18.385 I/mono-stdout( 5250): at Realms.Realm.GetInstance
(Realms.RealmConfiguration config) [0x0010c] in :0
05-15 12:57:18.385 I/mono-stdout( 5250): at Realms.Realm.GetInstance
(System.String databasePath) [0x00019] in :0 05-15
12:57:18.385 I/mono-stdout( 5250): at
MyApp.Activities.SplashScreenActivity+d__4.MoveNext ()
[0x00116] in
C:\Users***\Source\Repos\AppName\MyApp\Activities\SplashScreenActivity.cs:66
at Realms.Realm.GetInstance (Realms.RealmConfiguration config)
[0x0010c] in :0 at Realms.Realm.GetInstance
(System.String databasePath) [0x00019] in :0 at
MyApp.Activities.SplashScreenActivity+d__4.MoveNext ()
[0x00116] in
C:\Users***\Source\Repos\AppName\MyApp\Activities\SplashScreenActivity.cs:66
If I don't specify path I'm getting (var realm = Realm.GetInstance();):
System.ArgumentNullException: Value cannot be null. Parameter name:
type at System.Activator.CreateInstance (System.Type type, Boolean
nonPublic) [0x00006] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/activator.cs:205
05-15 13:05:05.257 I/mono-stdout( 5474): System.ArgumentNullException:
Value cannot be null. 05-15 13:05:05.257 I/mono-stdout( 5474):
Parameter name: type 05-15 13:05:05.257 I/mono-stdout( 5474): at
System.Activator.CreateInstance (System.Type type, Boolean nonPublic)
[0x00006] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/activator.cs:205
05-15 13:05:05.257 I/mono-stdout( 5474): at
System.Activator.CreateInstance (System.Type type) [0x00000] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/activator.cs:147
at System.Activator.CreateInstance (System.Type type) [0x00000] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/mscorlib/system/activator.cs:147
at Realms.Realm.CreateRealmObjectMetadata (System.Type
realmObjectType) [0x0001e] in :0 at
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement]
(IEnumerable1 source, System.Func2 keySelector, System.Func2
elementSelector, IEqualityComparer1 comparer) [0x0004d] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:855
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement]
(IEnumerable1 source, System.Func2 keySelector, System.Func2
elementSelector) [0x00000] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:847
at Realms.Realm..ctor (Realms.SharedRealmHandle sharedRealmHandle,
Realms.RealmConfiguration config) [0x00037] in <filename unknown>:0
at Realms .Realm.GetInstance (Realms.RealmConfiguration config)
[0x00171] in <filename unknown>:0 at
MyApp.Activities.SplashScreenActivity+<OnCreate>d__4.MoveNext ()
[0x00116] in
C:\Users\***\Source\Repos\AppName\MyApp\Activities\SplashScreenActivity.cs:66
05-15 13:05:05.257 I/mono-stdout( 5474): at
Realms.Realm.CreateRealmObjectMetadata (System.Type realmObjectType)
[0x0001e] in <filename unknown>:0 05-15 13:05:05.257 I/mono-stdout(
5474): at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement]
(IEnumerable1 source, System.Func2 keySelector, System.Func2
elementSelector, IEqualityComparer1 comparer) [0x0004d] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:855
05-15 13:05:05.257 I/mono-stdout( 5474): at
System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement]
(IEnumerable1 source, System.Func2 keySelector, System.Func2
elementSelector) [0x00000] in
/Users/builder/data/lanes/3053/a94a03b5/source/mono/external/referencesource/System.Core/System/Linq/Enumerable.cs:847
05-15 13:05:05.257 I/mono-stdout( 5474): at Realms.Realm..ctor
(Realms.SharedRealmHandle sharedRealmHandle, Realms.RealmConfiguration
config) [0x00037] in :0 05-15 13:05:05.257
I/mono-stdout( 5474): at Realms.Realm.GetInstance
(Realms.RealmConfiguration config) [0x00171] in :0
05-15 13:05:05.257 I/mono-stdout( 5474): at
MyApp.Activities.SplashScreenActivity+d__4.MoveNext ()
[0x00116] in
C:\Users***\Source\Repos\AppName\MyApp\Activities\SplashScreenActivity.cs:66
The app has Write external storage permission.
Realm and Fody nuget packages installed properly, Fody weavers are present as expected..
It also crashes with same exception using HTC One X with Android 4.2
The above attempt had other issues. There is a real bug currently in Realm with storage on external storage - see the issue https://github.com/realm/realm-dotnet/issues/554 which is proving awkward to debug.

Categories

Resources