Bug 24647 - ExceptionDispatchInfo::Throw does not replace capture stack trace
Summary: ExceptionDispatchInfo::Throw does not replace capture stack trace
Status: RESOLVED FIXED
Alias: None
Product: Runtime
Classification: Mono
Component: JIT ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks: 18629
  Show dependency tree
 
Reported: 2014-11-19 07:37 UTC by Marek Safar
Modified: 2015-04-13 11:46 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 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:
Status:
RESOLVED FIXED

Description Marek Safar 2014-11-19 07:37:37 UTC
Mono's ExceptionDispatchInfo.Throw captures exception but it should thrown captured exception from ExceptionDispatchInfo::Capture

>>>>>>>>>>>>>>>>>>>
using System;
using System.Diagnostics;
using System.Reflection;
using System.Threading.Tasks;
using System.Runtime.ExceptionServices;

public class Tests
{
	public static void Main (String[] args)
	{
		var e = new Exception ("test");
			
		var edi = ExceptionDispatchInfo.Capture (e);

		try {
			edi.Throw ();
		} catch {
		}

		edi.Throw ();

	}
}

Mono:

Unhandled Exception:
System.Exception: test
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Tests.Main (System.String[] args) [0x00000] in <filename unknown>:0
--- End of stack trace from previous location where exception was thrown ---
  at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x00000] in <filename unknown>:0
  at Tests.Main (System.String[] args) [0x00000] in <filename unknown>:0

.NET

Unhandled Exception: System.Exception: test
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Tests.Main(String[] args)
Comment 1 Marek Safar 2015-02-18 10:26:36 UTC
Could this please be addressed, it makes async stack traces pretty hard to read
Comment 2 Marek Safar 2015-04-13 11:46:36 UTC
Fixed in master