Bug 45530 - Variables and params randomly null on Samsung devices
Summary: Variables and params randomly null on Samsung devices
Status: NEEDINFO
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler (show other bugs)
Version: 7.0 (C8)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bernhard Urban
URL:
Depends on:
Blocks:
 
Reported: 2016-10-16 09:49 UTC by Jahmai
Modified: 2016-11-14 15:15 UTC (History)
6 users (show)

See Also:
Tags: XATriaged
Is this bug a regression?: ---
Last known good build:


Attachments

Description Jahmai 2016-10-16 09:49:53 UTC
For a long time we've been getting random crashes on Samsung SM-G920F, SM-G930F, SM-G935F, etc devices.
I had hoped they would be fixed by https://bugzilla.xamarin.com/show_bug.cgi?id=39859 but alas no.
The side effect is always the same, an ArgumentNullException or NullReferenceException somewhere it should be impossible.

I do not have a relevant device to reproduce the issue on, and so I've only ever seen it in the wild.
I do believe that the occurances have reduced since deploying https://bugzilla.xamarin.com/show_bug.cgi?id=39859 though, going purely of the reduction in frequency of Crashlytics reports.

Here is an example of the stack trace produced by this issue:

Fatal Exception: java.lang.Throwable: System.NullReferenceException: Object reference not set to an instance of an object
       at System.Threading.Tasks.TaskExceptionHolder.AddFaultException(System.Object exceptionObject)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.TaskExceptionHolder.Add(System.Object exceptionObject, System.Boolean representsCancellation)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.Task.AddException(System.Object exceptionObject, System.Boolean representsCancellation)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.Task.AddException(System.Object exceptionObject)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.Task`1[TResult].TrySetException(System.Object exceptionObject)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Exception exception)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.SetException(System.Exception exception)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at Intrinsic.Net.Sockets.SocketExtensions+<DoAsync>d__6.MoveNext()(<6418cfd8fdca4c5fbbca3d52aea31c39>)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object stateMachine)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.AwaitTaskContinuation.<ThrowAsyncIfNecessary>m__0(System.Object s)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object state)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ThreadPoolWorkQueue.Dispatch()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()(<128bb39fdc914b04b7c7b60d1350caf5>)


If you review the code, it should be quite impossible to get to that depth of the stack and produce a NullReferenceException.
This problem seems to always occur near the start of the application, too - during bootstrap code.
Comment 1 Jahmai 2016-10-17 09:27:47 UTC
Here's another one:

Fatal Exception: java.lang.Throwable: System.NullReferenceException: Object reference not set to an instance of an object
at Mono.Globalization.Unicode.SimpleCollator.CompareInternal(System.String s1, System.Int32 idx1, System.Int32 len1, System.String s2, System.Int32 idx2, System.Int32 len2, System.Boolean& targetConsumed, System.Boolean& sourceConsumed, System.Boolean skipHeadingExtenders, System.Boolean immediateBreakup, Mono.Globalization.Unicode.SimpleCollator+Context& ctx)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object stateMachine)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.Tasks.AwaitTaskContinuation.<ThrowAsyncIfNecessary>m__0(System.Object s)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object state)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading.ThreadPoolWorkQueue.Dispatch()(<128bb39fdc914b04b7c7b60d1350caf5>)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()(<128bb39fdc914b04b7c7b60d1350caf5>)
Comment 2 Jahmai 2016-10-17 10:42:08 UTC
Fatal Exception: java.lang.Throwable: System.InvalidCastException: Specified cast is not valid.
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object stateMachine)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.AwaitTaskContinuation.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ThreadPoolWorkQueue.Dispatch()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()(<128bb39fdc914b04b7c7b60d1350caf5>)
Comment 3 Bernhard Urban 2016-10-21 20:31:25 UTC
See https://bugzilla.xamarin.com/show_bug.cgi?id=45609#c8
Comment 4 Jahmai 2016-10-22 07:26:20 UTC
More nonsense:

Fatal Exception: java.lang.Throwable: System.IndexOutOfRangeException: Index was outside the bounds of the array.
       at System.Array.QSortArrange[K,V](K[] keys, V[] items, System.Int32 lo, System.Int32 hi, System.Collections.Generic.IComparer`1[T] comparer)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Array.qsort[K,V](K[] keys, V[] items, System.Int32 low0, System.Int32 high0, System.Collections.Generic.IComparer`1[T] comparer)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object stateMachine)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.Tasks.AwaitTaskContinuation.<ThrowAsyncIfNecessary>m__0(System.Object s)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object state)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading.ThreadPoolWorkQueue.Dispatch()(<128bb39fdc914b04b7c7b60d1350caf5>)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()(<128bb39fdc914b04b7c7b60d1350caf5>)
Comment 5 Jahmai 2016-10-31 11:00:27 UTC
Just released a new version compiled with the following, let's see if it resolves the issues or not:

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.6.01586

Installed Version: Professional

Visual Basic 2015   00322-40000-00000-AA585
Microsoft Visual Basic 2015

Visual C# 2015   00322-40000-00000-AA585
Microsoft Visual C# 2015

Visual C++ 2015   00322-40000-00000-AA585
Microsoft Visual C++ 2015

Visual F# 2015   00322-40000-00000-AA585
Microsoft Visual F# 2015

Windows Phone SDK 8.0 - ENU   00322-40000-00000-AA585
Windows Phone SDK 8.0 - ENU

ASP.NET and Web Tools 2015.1   14.1.20907.0
ASP.NET and Web Tools 2015.1

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

Azure App Service Tools v2.9.5   14.0.20810.0
Azure App Service Tools v2.9.5

Azure Data Lake Node   1.0
This package contains the Data Lake integration nodes for Server Explorer.

Azure Data Lake Tools for Visual Studio   2.1.0000.0
Microsoft Azure Data Lake Tools for Visual Studio

Command Bus, Event Stream and Async Manager   Merq
Provides ICommandBus, IEventStream and IAsyncManager MEF services for loosely coupled Visual Studio extension components communication and integration.

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

DataFactoryProject   1.0
Microsoft Data Factory Package

Debugging Tools for Windows   10.0.10586.0
Integrates the Windows Debugger functionality (http://go.microsoft.com/fwlink/?linkid=223405) in Visual Studio.

Fabric.DiagnosticEvents   1.0
Fabric Diagnostic Events

GitHub.VisualStudio   1.0
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

Microsoft .NET Core Tools (Preview 2)   14.1.20907.0
Microsoft .NET Core Tools (Preview 2)

Microsoft Azure Data Factory Node Node   1.0
Azure Data Factory extension for Visual Studio Server Explorer.

Microsoft Azure Hive Query Language Service   2.1.0000.0
Language service for Hive query

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.9.40715.2

Microsoft Azure Tools   2.8
Microsoft Azure Tools for Microsoft Visual Studio 2015 - v2.8.31121.1

NuGet Package Manager   3.5.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

ToolWindowHostedEditor   1.0
Hosting json editor into a tool window

Typemock.VSExtension   1.0
Information about my package

TypeScript   2.0.3.0
TypeScript tools for Visual Studio

Visual Studio Tools for Apache Cordova   Update 10
Visual Studio Tools for Apache Cordova

Visual Studio Tools for Universal Windows Apps   14.0.25527.01
The Visual Studio Tools for Universal Windows apps allow you to build a single universal app experience that can reach every device running Windows 10: phone, tablet, PC, and more. It includes the Microsoft Windows 10 Software Development Kit.

Windows Driver Kit   10.0.10586.0
Headers, libraries, and tools needed to develop, debug, and test Windows drivers (msdn.microsoft.com/en-us/windows/hardware/gg487428.aspx)

Windows Installer XML Toolset   3.10.3.3007
Windows Installer XML Toolset version 3.10.3.3007
Copyright (c) .NET Foundation and contributors. All rights reserved.

Xamarin   4.2.0.719 (15694b9)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   7.0.1.6 (5a02b03)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS   10.2.0.4 (b638977)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 6 Jahmai 2016-11-01 11:11:17 UTC
Alright, definitely still happening after using latest Xamarin.android, another zero'd out argument:

Fatal Exception: java.lang.Throwable: System.ArgumentException: The AddressFamily InterNetwork is not valid for the System.Net.IPEndPoint end point, use InterNetwork instead.
Parameter name: socketAddress
at System.Net.Sockets.SocketAsyncResult.CheckIfThrowDelayedException()(<c7b832bc451d410ebe37b68e85f9e329>)
at System.Net.Sockets.Socket.EndReceiveFrom(System.IAsyncResult result, System.Net.EndPoint& end_point)(<c7b832bc451d410ebe37b68e85f9e329>)
at System.Net.Sockets.Socket.<ReceiveFromAsyncCallback>m__A(System.IAsyncResult ares)(<c7b832bc451d410ebe37b68e85f9e329>)
at System.Net.Sockets.SocketAsyncResult+<Complete>c_AnonStorey0.<>m_0(System.Object _)(<c7b832bc451d410ebe37b68e85f9e329>)
at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()(<f73787475f2a4b899eb7dc48412c97c1>)
at System.Threading.ThreadPoolWorkQueue.Dispatch()(<f73787475f2a4b899eb7dc48412c97c1>)
at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()(<f73787475f2a4b899eb7dc48412c97c1>)
Comment 7 Jahmai 2016-11-04 11:06:19 UTC
Not very useful, but:

Fatal Exception: java.lang.Throwable: System.NullReferenceException: Object reference not set to an instance of an object
at System.Threading.Tasks.Task+ContingentProperties.DeregisterCancellationCallback()(<f73787475f2a4b899eb7dc48412c97c1>)
Comment 8 Jahmai 2016-11-04 23:27:21 UTC
We got one, Commander:

Fatal Exception: java.lang.Throwable: System.ExecutionEngineException: SIGILL
       at System.Runtime.Remoting.Messaging.AsyncResult.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.ThreadPoolWorkQueue.Dispatch()(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()(<f73787475f2a4b899eb7dc48412c97c1>)
Comment 9 Jahmai 2016-11-05 23:40:01 UTC
Fatal Exception: java.lang.Throwable: System.NullReferenceException: Object reference not set to an instance of an object
       at System.Threading.Tasks.TaskExceptionHolder.AddFaultException(System.Object exceptionObject)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.Tasks.TaskExceptionHolder.Add(System.Object exceptionObject, System.Boolean representsCancellation)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.Tasks.Task.AddException(System.Object exceptionObject, System.Boolean representsCancellation)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.Tasks.Task.AddException(System.Object exceptionObject)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.Tasks.Task`1[TResult].TrySetException(System.Object exceptionObject)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Runtime.CompilerServices.AsyncTaskMethodBuilder`1[TResult].SetException(System.Exception exception)(<f73787475f2a4b899eb7dc48412c97c1>)
       at Intrinsic.Net.DnsEx+<GetHostAddressesAsync>d__0.MoveNext()(<49cc6cb400d843c691a53a1e428749a3>)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.InvokeMoveNext(System.Object stateMachine)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Runtime.CompilerServices.AsyncMethodBuilderCore+MoveNextRunner.Run()(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.Tasks.AwaitTaskContinuation.RunOrScheduleAction(System.Action action, System.Boolean allowInlining, System.Threading.Tasks.Task& currentTask)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.Tasks.AwaitTaskContinuation.<ThrowAsyncIfNecessary>m__0(System.Object s)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context(System.Object state)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx)(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading.ThreadPoolWorkQueue.Dispatch()(<f73787475f2a4b899eb7dc48412c97c1>)
       at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()(<f73787475f2a4b899eb7dc48412c97c1>)

Note You need to log in before you can comment on or make changes to this bug.