Bug 29157 - Most of the stack trace is missing with 5.1
Summary: Most of the stack trace is missing with 5.1
Status: RESOLVED DUPLICATE of bug 30513
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 6.0 (C6)
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2015-04-16 11:24 UTC by Stephen Shaw
Modified: 2015-07-21 16:48 UTC (History)
3 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 DUPLICATE of bug 30513

Description Stephen Shaw 2015-04-16 11:24:52 UTC
When my Xamarin.Forms app crashes because of an unhandled exception with Xamarin.Android 5.1 most of the stacktrace is missing. This is all that I get:
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.InvalidOperationException: Sequence contains no elements
[MonoDroid] at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <IL 0x00011, 0x0004b>
[MonoDroid] at System.Runtime.CompilerServices.AsyncMethodBuilderCore.<ThrowAsync>m__0 (object) <IL 0x00006, 0x0003b>
[MonoDroid] at Android.App.SyncContext/<Post>c__AnonStorey0.<>m__0 () [0x00000] in /Users/builder/data/lanes/1502/218021d1/source/monodroid/src/Mono.Android/src/Android.App/SyncContext.cs:18
[MonoDroid] at Java.Lang.Thread/RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/1502/218021d1/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36
[MonoDroid] at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) [0x00009] in /Users/builder/data/lanes/1502/218021d1/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Java.Lang.IRunnable.cs:71
[MonoDroid] at (wrapper dynamic-method) object.91933fae-9b6c-4cac-ab44-ba972787c7cd (intptr,intptr) <IL 0x00011, 0x00027>
[AndroidRuntime] Shutting down VM


=======================
On stable (Xamarin.Android 5.0) I get:

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.InvalidOperationException: Sequence contains no elements
[MonoDroid]   at System.Linq.Enumerable.First[JobTask] (IEnumerable`1 source) [0x00000] in <filename unknown>:0 
[MonoDroid]   at SQLite.Net.SQLiteConnection.Get[JobTask] (System.Object pk) [0x00000] in <filename unknown>:0 
[MonoDroid]   at SQLite.Net.Async.SQLiteAsyncConnection+<>c__DisplayClass14`1[Models.Old.JobTask].<GetAsync>b__15 () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Threading.Tasks.TaskActionInvoker+FuncInvoke`1[Models.Old.JobTask].Invoke (System.Threading.Tasks.Task owner, System.Object state, System.Threading.Tasks.Task context) [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Threading.Tasks.Task.InnerInvoke () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Threading.Tasks.Task.ThreadStart () [0x00000] in <filename unknown>:0 
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter`1[Models.Old.JobTask].GetResult () [0x00000] in <filename unknown>:0 
[MonoDroid]   at CloudServices.SyncService+<SyncTaskNotes>c__async7.MoveNext () [0x0032b] in /Users/sshaw/code/CloudServices/SyncService.cs:387 
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0 
[MonoDroid]   at CloudServices.SyncService+<Sync>c__async3.MoveNext () [0x00225] in /Users/sshaw/code/CloudServices/SyncService.cs:151 
[MonoDroid] --- End of stack trace from previous location where exception was thrown ---
[MonoDroid]   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0 
[MonoDroid]   at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00000] in <filename unknown>:0 
[MonoDroid]   at CloudServices.SyncService+<SyncService>c__async12.MoveNext () [0x00021] in /Users/sshaw/code/CloudServices/SyncService.cs:66
Comment 1 Jonathan Pryor 2015-05-06 17:16:49 UTC
> When my Xamarin.Forms app crashes because of an unhandled exception with
> Xamarin.Android 5.1 most of the stacktrace is missing. 

Please provide a complete repro. Based on the stack traces in Comment #0, async/await is involved, but other than that the two stack traces appear to be ~entirely different -- the 5.1 stack trace is due to an IRunnable invocation (*probably* due to Activity.RunOnUiThread() or similar), while the "5.0" stack trace is presumably from a Task-related thread.

As a *guess*, the change you're seeing is *probably* due to our (now functional) cross-VM exception support:

http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.1/#Cross-VM_Exception_Propagation
Comment 2 Peter Collins 2015-05-07 17:39:24 UTC
Moving to SR2 milestone as we haven't managed to nail down a consistent repro.
Comment 3 Jonathan Pryor 2015-05-27 18:04:38 UTC
It's plausible that this is a DUPE of Bug #30513: Exceptions thrown from `async` methods do not show the method they were thrown from.
Comment 4 Peter Collins 2015-06-03 16:02:08 UTC
@sshaw Any idea if this is still reproducible? If it is indeed a duplicate of Bug #30513, it should now be fixed in master.
Comment 5 Peter Collins 2015-07-07 11:57:13 UTC
I'm going to bump this to C6 for re-evaluation, I'm not aware of any other reports of this issue and it is possible that it has since been fixed.
Comment 6 Peter Collins 2015-07-21 16:48:04 UTC
Flagging as a dupe of #30513.

*** This bug has been marked as a duplicate of bug 30513 ***