[Mono-bugs] [Bug 36382][Maj] Changed - NullReference exception thrown not correct by System.Diagnostics.StackTrace class

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 7 Jan 2003 09:43:00 -0500 (EST)


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 gkodinov@openlinksw.co.uk.

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

--- shadow/36382	Tue Jan  7 08:48:59 2003
+++ shadow/36382.tmp.32239	Tue Jan  7 09:43:00 2003
@@ -2,13 +2,13 @@
 Product: Mono/Runtime
 Version: unspecified
 OS: Red Hat 8.0
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Major
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: gkodinov@openlinksw.co.uk               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -29,6 +29,21 @@
 {
   public static void Main (String [] args)
     {
       Console.WriteLine (new System.Diagnostics.StackTrace());
     }
 }
+
+------- Additional Comments From gkodinov@openlinksw.co.uk  2003-01-07 09:43 -------
+Little analysis :
+StackTrace() constructor throws NullReference exception because 
+x86_unwind_native_frame signals SIGSEGV in unwinding the GCC frame 
+above the first managed code frame (from mono.c).
+The same code works fine if in a thread (created by the managed 
+code), because of it having an aditional managed frame above the 
+max_stack.
+
+In that respect it would be beneficial to apply the following diff 
+(fixit.diff - attached). This diff makes threads calling 
+mono_thread_attach() to behave in the same way as the initial thread 
+(throw NullReference instead of GPF-ing).
+