Bug 52375 - Exceptions in UIView.Animate delegates lose stacktrace
Summary: Exceptions in UIView.Animate delegates lose stacktrace
Alias: None
Product: iOS
Classification: Xamarin
Component: XI runtime (show other bugs)
Version: XI 10.3 (iOS 10.2)
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: Future Cycle (TBD)
Assignee: Bugzilla
Depends on:
Reported: 2017-02-08 05:17 UTC by Dan
Modified: 2017-02-08 10:46 UTC (History)
3 users (show)

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

Sample (26.50 KB, application/zip)
2017-02-08 05:17 UTC, Dan

Description Dan 2017-02-08 05:17:35 UTC
Created attachment 19754 [details]

Exceptions thrown in the completion delegates for UIView.Animate do not seem to be handled properly by the runtime or debugger.  In particular, it is observed that (1) the debugger breaks on the UIApplication.Main method, rather than the actual site of the exception, and (2) any stack trace determining where the exception was triggered is lost.

Attached is a sample solution w/ a single iOS project demonstrating the issue.  This solution was created via "New Solution... => iOS App => Single View App" and making the necessary code changes to ApplicationDelegate.cs and ViewController.cs.  By selectively commenting-uncommenting cases in the ViewController.cs class, one can reproduce the behavior described above.  The observed stack traces are included in the comments.

It is expected that exceptions which are thrown from delegates contain the correct stack trace to the throw-site of the exception.

Additional notes: this same type of stack trace (one that claims to fire from UIApplication.Main) is observed as well in crash reporting tools for a separate project, suggesting it is not simply an issue w/ the debugger itself.

Project was built on OS X w/:
  Xamarin Studio Community 6.1.5
Comment 1 Manuel de la Peña [MSFT] 2017-02-08 09:35:08 UTC
Confirming the bug with:

=== Xamarin Studio Community ===

Version 6.1.5 (build 0)
Installation UUID: 01060673-5bee-4cf4-a4c2-5e36a18d39a2
	Mono 4.9.0 (master/60b660d) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 409000613

=== NuGet ===


=== Xamarin.Profiler ===

Not Installed

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.Mac ===

Version: (Xamarin Studio Community)

=== Xamarin.Android ===

Version: (Xamarin Studio Community)
Android SDK: /Users/mandel/Library/Developer/Xamarin/android-sdk-macosx
	Supported Android versions:
		4.0.3 (API level 15)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
		6.0   (API level 23)

SDK Tools Version: 25.1.6
SDK Platform Tools Version: 24.0.0
SDK Build Tools Version: 23.0.2

Java SDK: /usr
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

Android Designer EPL code available here:

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Xamarin.iOS ===

Version: (Xamarin Studio Community)
Hash: 7beaef4
Branch: cycle8-xi
Build date: 2016-12-20 02:58:14-0500

=== Xamarin Inspector ===

Hash: 1f3067d
Branch: master
Build date: 11/15/2016 10:13:59 PM

=== Build Information ===

Release ID: 601050000
Git revision: 7494718e127af9eaec45a3bd6282d3da927488bd
Build date: 2017-01-17 10:31:01-05
Xamarin addins: c92d0626d347aaa02839689eaac2961d24c9f446
Build lane: monodevelop-lion-cycle8

=== Operating System ===

Mac OS X 10.12.3
Darwin MacBook-Pro.local 16.4.0 Darwin Kernel Version 16.4.0
    Thu Dec 22 22:53:21 PST 2016
    root:xnu-3789.41.3~3/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

Addin Maker 1.3.2
StyleCop Support
Xamarin Inspector
Comment 2 Rolf Bjarne Kvinge [MSFT] 2017-02-08 10:41:55 UTC
@Manuel, I believe this is fixed in Cycle9, can you try?
Comment 3 Manuel de la Peña [MSFT] 2017-02-08 10:46:46 UTC
@Rolf, sure, will check c9 and master

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