Bug 31431 - Crash in ExceptionServices.ExceptionDispatchInfo.Throw
Summary: Crash in ExceptionServices.ExceptionDispatchInfo.Throw
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Marek Habersack
URL:
Depends on:
Blocks:
 
Reported: 2015-06-27 08:27 UTC by Adam Kapos
Modified: 2017-09-19 16:54 UTC (History)
5 users (show)

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

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description Adam Kapos 2015-06-27 08:27:38 UTC
We have received reports of the following exceptions:

Object reference not set to an instance of an object
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
 at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
 at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
 at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>

Argument cannot be null.
Parameter name: source
 at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
 at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <0x0003f>
 at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () <0x00027>
 at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
 at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>

We receive about 5-10 reports per day from our users. This is a release build published in Google Play.

Most of the exceptions seem to occur after calling Task.Run.

Some of the devices affected (doesn't seem to be device specific):

FUJITSU F-05E running 4.1.2
Huawei G750-T00 running 4.4.2 
samsung GT-S7275B running 4.2.2 
LGE LG-D410 running 5.0.2 
SHARP SBM303SH running 4.2.2
samsung SM-G900F running 5.0 
HUAWEI Hol-U10 running 4.2.2 
zte Z970 running 4.4.2 
samsung SM-G530BT running 4.4.4 
motorola XT1040 running 4.4.4
LENOVO Lenovo A319 running 4.4.2 
ZTE Blade L2 running 4.2.2 

Xamarin version:
Xamarin   3.11.590.0 (5160db7)
Xamarin.Android   5.1.3.1 (d419c934e6ce2113653ff4c40214e3a5d5a69440)
Comment 1 Adam Kapos 2015-07-02 03:02:51 UTC
Any updates?
Comment 2 Sunil Kumar 2015-07-02 08:32:23 UTC
@Adam, Could you please provide us test sample/steps to reproduce this issue at our end.

Also if possible could you please provide Ide log.
For VS Ide log, location: VS-> Help-> Xamarin-> Zip Xamarin logs
For XS Ide log, location: XS-> Help-> Open log Directory

Thanks
Comment 3 Adam Kapos 2015-07-02 17:03:53 UTC
The problem we have with these Android crashes is that we are receiving error reports, but there is no repro case because it's random and/or device specific.

Is there any kind of info I could collect from the users that could help you track this down?
Comment 4 Dmitry 2015-07-28 09:33:29 UTC
Hello. I noticed, that on last Xamarin build(Xamarin 3.11.666.0, Xamarin.Android 5.1.4.16) exceptions in background threads are not logged in stacktrace. I just see 


07-28 16:41:38.105 E/AndroidRuntime(27505): Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
07-28 16:41:38.105 E/AndroidRuntime(27505): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x00078>
07-28 16:41:38.105 E/AndroidRuntime(27505): at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <IL 0x00006, 0x0006b>
07-28 16:41:38.105 E/AndroidRuntime(27505): at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Android.App/SyncContext.cs:18
07-28 16:41:38.105 E/AndroidRuntime(27505): at Java.Lang.Thread/RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36
07-28 16:41:38.105 E/AndroidRuntime(27505): at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) [0x00009] in /Users/builder/data/lanes/1879/5f55a9ef/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Java.Lang.IRunnable.cs:71
07-28 16:41:38.105 E/AndroidRuntime(27505): at (wrapper dynamic-method) object.331c72f3-0967-4476-be08-8624041de6a2 (intptr,intptr) <IL 0x00011, 0x0003b>

Thanks
Comment 5 Cody Beyer (MSFT) 2015-08-29 13:14:12 UTC
I believe that the generic stack trace is related to the following bug, as related to comment 4. 

It is most likely prudent to provide any new stack traces that arise after the below referenced bug fix is released, as it is very likely that the seemingly related errors to this bug ticket are actually completely unrelated, but are hiding their stack trace.

https://bugzilla.xamarin.com/show_bug.cgi?id=33305

Thanks!
Comment 6 Jon Douglas [MSFT] 2017-09-19 16:54:30 UTC
Thank you for taking the time to submit this report. After reviewing the description of this bug, we believe it no longer affects the current version of Xamarin.Android. If you are still experiencing the issue after updating your packages, please reopen this report with an attached reproduction.