Bug 23076 - Exceptions thrown from async methods on device cause "Debug information is not available for this frame"
Summary: Exceptions thrown from async methods on device cause "Debug information is no...
Status: VERIFIED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: Debugger ()
Version: 3.5
Hardware: PC Windows
: High major
Target Milestone: 3.9
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-09-16 22:31 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2016-05-10 17:01 UTC (History)
14 users (show)

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


Attachments
Test case (7.58 KB, application/zip)
2014-09-16 22:31 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details
Stack trace from Device console (for failing case) (5.56 KB, text/plain)
2014-09-16 22:34 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


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 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:
VERIFIED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2014-09-16 22:31:49 UTC
Created attachment 8083 [details]
Test case

Exceptions thrown from async methods on device cause a "Debug information is not available for this frame" AbsentInformationException in the VS debugger.

Regression status: regression.

Fails on Xamarin 3.5.58 and Xamarin 3.6.239.
Works on Xamarin 3.3.47.

Only fails on device. Works on the iOS simulator on 3.5.58 and 3.6.239.


## Steps to reproduce

1. Run the attached test case on device (tested on iPhone 4s, iOS 7.1.2).

2. Tap the "Button" button.


## Bad Result
   Xamarin 3.6.239 + Xamarin.iOS 8.0.0.60
or Xamarin 3.5.58  + Xamarin.iOS 7.4.0.108

The VS Output -> Debug window shows:

> Mono.Debugger.Soft.AbsentInformationException: Debug information is not available for this frame.
>    at Mono.Debugger.Soft.VirtualMachine.ErrorHandler(Object sender, ErrorHandlerEventArgs args)
>    at Mono.Debugger.Soft.Connection.SendReceive(CommandSet command_set, Int32 command, PacketWriter packet)
>    at Mono.Debugger.Soft.Connection.StackFrame_GetThis(Int64 thread_id, Int64 id)
>    at Mono.Debugger.Soft.StackFrame.GetThis()
>    at Mono.Debugging.Soft.ThisValueReference.get_Value()
>    at Mono.Debugging.Soft.SoftDebuggerAdaptor.GetHoistedLocalVariables(SoftEvaluationContext cx, ValueReference vthis)
>    at Mono.Debugging.Soft.SoftDebuggerAdaptor.OnGetLocalVariables(EvaluationContext ctx)
>    at Mono.Debugging.Evaluation.ExpressionEvaluator.GetLocalVariables(EvaluationContext ctx)
>    at Mono.Debugging.Evaluation.BaseBacktrace.GetFrameInfo(Int32 frameIndex, EvaluationOptions options, Boolean ignoreEvalStatus)
>    at Mono.Debugging.Evaluation.BaseBacktrace.GetException(Int32 frameIndex, EvaluationOptions options)
>    at Xamarin.VisualStudio.Debugger.MonoToolsDebuggerSession.OnUnhandledException(Object sender, TargetEventArgs args)
>    at Mono.Debugging.Client.DebuggerSession.OnTargetEvent(TargetEventArgs args)
>    at Mono.Debugging.Soft.SoftDebuggerSession.HandleBreakEventSet(Event[] es, Boolean dequeuing)
>    at Mono.Debugging.Soft.SoftDebuggerSession.HandleEventSet(EventSet es)
>    at Mono.Debugging.Soft.SoftDebuggerSession.EventHandler()


### The Console log from the device still shows the "real" exception

After you click the "Stop debugging" button in Visual Studio, the app dumps the "real" exception to the device's Console (viewable in Xcode Organizer).

Full stack trace from the device Console attached.


## Good result: Xamarin.iOS 7.2.6.28 + Xamarin 3.3.47
> Unhandled managed exception: An Exception (System.Exception)
>   at iPhoneApp1.iPhoneApp1ViewController+<Method1>d__2.MoveNext () [0x000a8] in c:\Users\Windows User\Desktop\AsyncException\iPhoneApp1\iPhoneApp1ViewController.cs:28 
> --- End of stack trace from previous location where exception was thrown ---
>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62 
>   at System.Runtime.CompilerServices.TaskAwaiter`1[System.Int32].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59 
>   at iPhoneApp1.iPhoneApp1ViewController+<OnTouchUpInside>d__5.MoveNext () [0x0001b] in c:\Users\Windows User\Desktop\AsyncException\iPhoneApp1\iPhoneApp1ViewController.cs:34 


## Good result: Xamarin.iOS 8.0.0.60 + Xamarin Studio 5.4 (build 239)
> Unhandled managed exception: An Exception (System.Exception)
>   at iPhoneApp1.iPhoneApp1ViewController+<Method1>c__async0.MoveNext () [0x00093] in /Volumes/ramdisk/AsyncException/iPhoneApp1/iPhoneApp1ViewController.cs:28 
> --- End of stack trace from previous location where exception was thrown ---
>   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62 
>   at System.Runtime.CompilerServices.TaskAwaiter`1[System.Int32].GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter_T.cs:59 
>   at iPhoneApp1.iPhoneApp1ViewController+<OnTouchUpInside>c__async1.MoveNext () [0x00022] in /Volumes/ramdisk/AsyncException/iPhoneApp1/iPhoneApp1ViewController.cs:34 


## Version information

### Beta versions tested
Xamarin   3.6.239.0 (f79ef6eadc52a50c387f60f774ae3cee6782fdfb)
Xamarin.iOS 8.0.0.60 (Business Edition), Hash: b26679f

Xamarin Studio 5.4 (build 239)
Git revision: 338110385bb89c5774e89ffcb15d8f2039e7fbcd
Xamarin addins: 05241f5ab70cf79388a0f113bc6877780ed1024a


### Current stable versions tested
Xamarin   3.5.58.0 (6b70b1e28c5a733187f7659220da4c0ff61ab2b1)
Xamarin.iOS 7.4.0.108


### Old stable versions tested
Xamarin   3.3.47
Xamarin.iOS 7.2.6.28


### Same across all tests
Mono 3.8.0 (no/45d0ba1)
Xcode 5.1 (5084), Build 5B130a
Mac OS X 10.9.4
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2014-09-16 22:34:59 UTC
Created attachment 8084 [details]
Stack trace from Device console (for failing case)
Comment 9 mag@xamarin.com 2014-09-30 14:20:24 UTC
Fixed
Commit: 2dc773b9f7cd19fd819dd07f382feae387c6b3fc
Wrench: 7663ae56b800842c0709b9fec1cc33603aa33a53
Comment 10 narayanp 2014-10-01 11:55:36 UTC
I have checked this issue and now it works fine. We are getting expected exception on tapping the "Button" button.

Screencast: http://www.screencast.com/t/F5yUfTZyt

Environment info:
Microsoft Visual Studio Professional 2013
Version 12.0.30501.00 Update 2
Microsoft .NET Framework
Version 4.5.50938

Xamarin   3.7.191.0 (8ed3fc1c94db017633cea8d857666d3c27f4d349)
Xamarin.Android   4.18.0.32 (04399d62cfc00624d575239d1762ea4fd6d012e2)
Xamarin.iOS   8.2.0.0 (e934614f2e5a410acb3d62a2994c27a3e770a91e)


Build Host info:
X.iOS 8.2.0.191

iPhone 5s iOS 7.1
Comment 11 Brendan Zagaeski (Xamarin Team, assistant) 2014-11-18 00:27:20 UTC
Reopening because the test case is broken again.


## Bad versions

Xamarin   3.8.145.0 (bd95bb97b6f8c7dfd6486b6ae3d967149022c95e)
Xamarin.Android   4.20.0.26 (4f8f6db2eeda44dab7d4c42eb381725b3035662d)
Xamarin.iOS   8.4.0.0 (84277d4b8fb363af32626a5263977f03227a1fdf)


### Mac build host

Xamarin.iOS 8.4.0.43 (840a925103a0bf4a856507f13d5eaee3c1579c2f)



## Good versions

Xamarin   3.7.226.0 (bde1ced5c221b04ff6c6c147e50fd5ca0000cbd1)
Xamarin.Android   4.18.0.38 (c0168255507205e3f50aba560ccf971c41a682ff)
Xamarin.iOS   8.2.0.0 (06812e63c56a62c5ed6298167da3c71c6baf8852)

### Mac build host
Xamarin.iOS 8.2.0.207 (3bf072d)



## Additional version information

Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641
Comment 12 Emanuel 2014-11-25 15:17:09 UTC
V3.9:
Commit: 15888dce7307dca6f0b38a21a2d6c10f244cdea2
Wrench: 4fe3e198ba0e48d256168890cafa173655e28757
Comment 13 Parmendra Kumar 2014-11-27 10:39:24 UTC
Unable to verify this issue due to bug:
https://bugzilla.xamarin.com/show_bug.cgi?id=24835
Comment 14 Ram Chandra 2014-12-08 11:05:29 UTC
I have checked this issue and observed that click on "button" its throw exception.

Screencast: http://www.screencast.com/t/8izqOba9c
Device Log: https://gist.github.com/Ram360Logica/ec07c010b8973df9cac7
Debug Log: https://gist.github.com/RamChBachkheti/3f796a0c47461ab07817
IDE Log: https://gist.github.com/RamChBachkheti/c9669c9c32b48cfef360

Environment info:
Microsoft Visual Studio Professional 2013
Version 12.0.30723.00 Update 3
Microsoft .NET Framework
Version 4.5.51641

Installed Version: Professional

Xamarin   3.9.125.0 
Xamarin.Android   4.20.0.28 
Xamarin.iOS   8.6.0.0 

This issue still exist. Hence I am reopen this issue
Comment 15 Brendan Zagaeski (Xamarin Team, assistant) 2014-12-08 11:18:19 UTC
The exception shown in the screencast in comment 14 is the correct "System.Exception" exception (thrown by the iOS app). This bug is about cases where the debugger _itself_ throws a "Mono.Debugger.Soft.AbsentInformationException" when attempting to break on an exception thrown by the iOS app from within an async method.

In short, based on comment 14, this bug looks fixed to me :)
Comment 16 Ram Chandra 2014-12-08 12:11:48 UTC
As per comment 15 , this issue has been fixed and working fine.

Hence I am closing this issue.