Bug 36763 - Exception class does not report proper stack trace
Summary: Exception class does not report proper stack trace
Status: RESOLVED DUPLICATE of bug 33305
Alias: None
Product: Class Libraries
Classification: Mono
Component: General ()
Version: 4.2.0 (C6)
Hardware: PC Mac OS
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
Depends on:
Reported: 2015-12-09 14:07 UTC by John Miller [MSFT]
Modified: 2015-12-10 15:38 UTC (History)
3 users (show)

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 GitHub or 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:

Description John Miller [MSFT] 2015-12-09 14:07:07 UTC

   Customers are often seeing reports of stack traces like the following:

> at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00028>
> at System.Runtime.CompilerServices.AsyncMethodBuilderCore.m__0 (object) <0x0003f>
> at Android.App.SyncContext/c__AnonStorey0.<>m__0 () <0x00027>
>at Java.Lang.Thread/RunnableImplementor.Run () <0x0003f>
>at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) <0x0003b>
> at (wrapper dynamic-method) object.31f43723-97b7-438f-9a43-a2a20d7dd8af (intptr,intptr) <0x0003b>

More context here: https://forums.xamarin.com/discussion/comment/139241/

**Actual Results:**

   The above stack trace is reported incorrectly. However, when reproduced, a customer noticed that there is better stack trace information available. 

**Expected Results:**

   See the forum post for more info on what's expected. 

**Build Date & Platform:**

   Mono 4.2 
   XI 9.2

**Additional Information:**

   The users on the forum were able to work around this by using reflection to set the private field "stack_trace" to null in the Exception class so that it's rebuilt when the public properties are used for things like Insights.
Comment 1 Marek Safar 2015-12-09 14:42:09 UTC

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