[Mono-bugs] [Bug 56782][Nor] New - rethrown exceptions lose original stack trace

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 10 Apr 2004 07:24:09 -0400 (EDT)


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 vladimir@pobox.com.

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

--- shadow/56782	2004-04-10 07:24:09.000000000 -0400
+++ shadow/56782.tmp.25897	2004-04-10 07:24:09.000000000 -0400
@@ -0,0 +1,62 @@
+Bug#: 56782
+Product: Mono: Runtime
+Version: unspecified
+OS: Red Hat 9.0
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: vladimir@pobox.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: rethrown exceptions lose original stack trace
+
+Exceptions that get rethrown via "throw;" in a handler lose the actual
+origin stack trace under mono, but do not under the MS runtime. Sample code:
+
+--- bug29.cs ---
+using System;
+public class Driver {
+        public static void Frob () {
+                throw new NotImplementedException();
+        }
+        public static void Bar () {
+                try {
+                        Frob();
+                } catch (Exception e) {
+                        Console.WriteLine ("Exception!");
+                        throw;
+                }
+        }
+        public static void Main () {
+                Bar();
+        }
+}
+--- end ---
+
+Under the MS runtime, this prints:
+$ ./ex
+Exception!
+
+Unhandled Exception: System.NotImplementedException: The method or
+operation is not implemented.
+   at Driver.Frob()
+   at Driver.Bar()
+   at Driver.Main()
+Unknown signal 79
+
+Under mono:
+vladimir@river[1003]% mono bug29.exe
+Exception!
+
+Unhandled Exception: System.NotImplementedException: The requested feature
+is not implemented.
+in <0x0002f> Driver:Bar ()
+in <0x00007> Driver:Main ()
+
+The Frob() frame is lost.