[Mono-bugs] [Bug 45043][Wis] Changed - unwinding segfault

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 18 Jun 2003 06:31:35 -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 lupus@ximian.com.

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

--- shadow/45043	Wed Jun 18 01:36:10 2003
+++ shadow/45043.tmp.10652	Wed Jun 18 06:31:34 2003
@@ -1,23 +1,23 @@
 Bug#: 45043
 Product: Mono/Runtime
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Wishlist
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: tum@veridicus.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
-Summary: Mono fails to throw OutOfMemoryException
+Summary: unwinding segfault
 
 Description of Problem:
 
 Allocating an array of size Int32.MaxValue should cause Mono to throw an 
 OutOfMemoryException.
 
@@ -34,6 +34,39 @@
 
 OutOfMemoryException
 
 How often does this happen? 
 
 All the time.
+
+------- Additional Comments From lupus@ximian.com  2003-06-18 06:31 -------
+The original issue was an overflow ehn calculationg the byte size of
+the array: this resulted in a very small allocation. We now throw the
+out of memory exception when the calculation leads to an overflow, but
+there is a bug that causes the unwinding code to segfault at least for me.
+The complete test case is as follows:
+using System;
+
+class T {
+	static void Main () {
+		try {
+			object[] array = new object[Int32.MaxValue];
+			if (array == null) {
+				Console.WriteLine ("null");
+			} else {
+				object a = array [Int32.MaxValue / 3];
+			}
+		} catch (OutOfMemoryException) {
+			Console.WriteLine ("got out of mem");
+		}
+	}
+}
+The stack trace looks like:
+#0  0x40153672 in _Unwind_GetTextRelBase () from /lib/libgcc_s.so.1
+#1  0x401537ad in __frame_state_for () from /lib/libgcc_s.so.1
+#2  0x4034d20f in __frame_state_for () from /lib/libc.so.6
+#3  0x40077c57 in x86_unwind_native_frame (domain=0x805ef80,
+jit_tls=0x80e4338, ctx=0xbf5ff6f0, new_ctx=0xbf5ff610, lmf=0x80e6728,
+trace=0xbf5ff670) at exceptions-x86.c:399
+
+It might be a libc issue, anyone can reproduce?
+