[Mono-bugs] [Bug 68552][Nor] Changed - Abort exception not properly rethrown in some cases

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Thu Jul 7 07:47:28 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by kornelpal at hotmail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=68552

--- shadow/68552	2005-07-07 07:02:54.000000000 -0400
+++ shadow/68552.tmp.3794	2005-07-07 07:47:28.000000000 -0400
@@ -1,9 +1,9 @@
 Bug#: 68552
 Product: Mono: Runtime
-Version: unspecified
+Version: 1.0
 OS: Windows XP (Cygwin)
 OS Details: Windows XP SP2
 Status: REOPENED   
 Resolution: 
 Severity: Unknown
 Priority: Normal
@@ -225,6 +225,52 @@
 ------- Additional Comments From vargaz at gmail.com  2005-07-07 07:02 -------
 The behaviour of the MS runtime on lluis's testcase contradicts this,
 since in that testcase, the abort exception should be rethrown at the
 end of the catch statement in 'Run'. Instead, it is rethrown at the
 end of the catch statement in 'Main'.
 
+
+------- Additional Comments From kornelpal at hotmail.com  2005-07-07 07:47 -------
+In the last test of Lluis "Should not print this" is printed on Mono 
+but not on MS runtime. This is the behaviour I have described in my 
+previous comment. If you experienced different behaviour please let 
+me know.
+
+Your "Should not print this" is printed because it is inside a catch 
+block that catched ThreadAbortException so the runtime did not 
+rethrow ThreadAbortException yet nor you have thrown an exception 
+that could prevent "Should not print this" to be printed.
+
+Unfortunately I was too tired and forgot some words.:) The 
+difference is marked with []:
+
+"Another important thing is that you can throw a different exception 
+before the catch block that catched ThreadAbortException [is 
+leaved]. In this case ThreadAbortException will not be rethrown 
+until an uplevel catch block that catched the new exception is 
+leaved normally. In addition exceptions can be thrown by finally 
+blocks as well. In this case the same applies as for catch blocks: 
+ThreadAbortException will be rethrown when a catch block that 
+catched the new exception is leaved."
+
+Thread.Abort only requires an exception on the stack until the 
+beginning of the stack is reached to succeed. Thus no 
+ThreadAbortException is thrown when there is another exception on 
+the stack. But if the exception (ThreadAbortException or any other 
+exception) is caught and no new exception is thrown runtime will 
+rethrow ThreadAbortException to be able to continue unwinding.
+
+So the runtime does not have to deal with ThreadAbortException other 
+than throwing it ThreadAbortException because the exception that is 
+on the stack can have any type. The only thing it has to know is 
+whether the expection is the abortion exception or a usual 
+exception. And when the catch and finally block is leaved that 
+catched the abortion exception then ThreadAbortException has to be 
+rethrown. But it shouldn't be rethrown in any other situation.
+
+In other words: ThreadAbortException will be rethrown only when the 
+catch block that caught ThreadAbortException (or any other exception 
+that was used instead of ThreadAbortException as described above) is 
+leaved without throwing any exception and the finally block for the 
+same try block did throw any exception.
+
+If you still have questions please let me know.


More information about the mono-bugs mailing list