[Mono-bugs] [Bug 45817][Nor] Changed - mono hangs on exception backtrace

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Mon, 7 Jul 2003 00:37:39 -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 mathpup@mylinuxisp.com.

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

--- shadow/45817	Sun Jul  6 23:45:59 2003
+++ shadow/45817.tmp.14272	Mon Jul  7 00:37:39 2003
@@ -1,16 +1,16 @@
 Bug#: 45817
-Product: Mono/MCS
+Product: Mono/Runtime
 Version: unspecified
 OS: unknown
 OS Details: Debian sid
 Status: NEW   
 Resolution: 
 Severity: Unknown
 Priority: Normal
-Component: Misc
+Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: m.canini@libero.it               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Summary: mono hangs on exception backtrace
@@ -353,6 +353,57 @@
 ------- Additional Comments From bmaurer@users.sf.net  2003-07-06 23:44 -------
 Marcus just did csc/mono and it worked, so this is an mcs bug.
 
 ------- Additional Comments From miguel@ximian.com  2003-07-06 23:45 -------
 Resetting priority to Normal.  Read the priority guidelines for MCS to
 understand this.
+
+------- Additional Comments From mathpup@mylinuxisp.com  2003-07-07 00:37 -------
+This appears to be a runtime bug rather than a compiler bug. When I compiled 
+the code BenM posted with csc originally, I had optimization on, and csc 
+completely optimated the "types" local variable away. mcs generates 
+initialization statement for each element of the array, even though the 
+elements are all null. csc (without optimization) only creates the array and 
+relies on default initialization. 
+ 
+Changing the element of the array from "null" to "new Object()" causes the 
+bug to appear with csc + mono, giving the exception: 
+ 
+Unhandled Exception: System.NullReferenceException: A null value was found 
+where an object instance was required 
+in (unmanaged) /usr/local/lib/libmono.so.0(mono_class_vtable+0x1f2) 
+[0x400931d8] 
+in (unmanaged) /usr/local/lib/libmono.so.0(mono_array_new_full+0x1e1) 
+[0x40095389] 
+in (unmanaged) /usr/local/lib/libmono.so.0 [0x4002e76a] 
+in <0x0002c> 00 .Bug:nullrefexc () 
+in <0x00014> 00 .Bug:Main () 
+ 
+ 
+Program code: 
+ 
+using System; 
+ 
+public class Bug { 
+        static void Main () 
+        { 
+                Console.WriteLine ("Bugged"); 
+                nullrefexc (); 
+        } 
+ 
+        static void nullrefexc () 
+        { 
+                object[,] types = new object[,] { 
+                        {new Object(), new Object(), new Object(), new Object(), new 
+Object(), new Object(), new Object(), new Object(), new Object(), new 
+Object(), new Object(), 
+new Object(), new Object(), new Object(), new Object(), new Object(), new 
+Object(), new Object()}, 
+                        {new Object(), new Object(), new Object(), new Object(), new 
+Object(), new Object(), new Object(), new Object(), new Object(), new 
+Object(), new Object(), 
+new Object(), new Object(), new Object(), new Object(), new Object(), new 
+Object(), new Object()}, 
+                }; 
+        } 
+} 
+