[Mono-bugs] [Bug 62574][Min] New - X86: multiple locallocs results in weird behavior

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 5 Aug 2004 15:27:22 -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 enplo00@yahoo.com.

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

--- shadow/62574	2004-08-05 15:27:22.000000000 -0400
+++ shadow/62574.tmp.16191	2004-08-05 15:27:22.000000000 -0400
@@ -0,0 +1,97 @@
+Bug#: 62574
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: Kernel 2.6.4-ck2
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Minor
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: enplo00@yahoo.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: X86: multiple locallocs results in weird behavior
+
+Description of Problem:
+The Mono JIT interpreter throws a null reference exception or crashes when
+accessing memory that is allocated using localloc, if multiple localloc's
+are executed. Tested in x86 with Mono release 1.0. The mint interpreter
+works correctly.
+
+Steps to reproduce the problem:
+Compile and run the following cil program.
+------ locallocTest2.il -------------------------------
+// Doing multiple localloc's and accessing the allocated memory leads to a
+crash.
+
+.assembly extern mscorlib{}
+.assembly someTest{}
+.module someTest
+
+.class private auto ansi someTest
+       extends [mscorlib]System.Object {
+
+  .method public static void  go() cil managed {
+    .entrypoint
+
+	.locals init (native int, native int, native int)
+
+ldc.i4 6
+localloc
+conv.i
+stloc.0
+
+ldc.i4 6
+localloc
+conv.i
+stloc.1
+
+ldc.i4 6
+localloc
+conv.i
+stloc.2
+
+// br OK1
+ldloc.1
+ldc.i4 999999
+stind.i4
+ldloc.1
+ldind.i4
+ldc.i4 999999
+beq OK1
+br FAIL
+
+OK1:
+ldloc.0
+ldc.i4 999999
+stind.i4
+ldloc.0
+ldind.i4
+ldc.i4 999999
+beq PASS
+
+
+FAIL:	ldstr "FAIL"
+	call void [mscorlib]System.Console::WriteLine(string)
+	br END
+
+PASS:	ldstr "PASS"
+	call void [mscorlib]System.Console::WriteLine(string)
+
+END:	ret
+  }
+
+
+} 
+
+-------------------------------------------------------
+
+Actual Results:
+The JIT interpreter stops because of an unhandled
+System.NullReferenceException when accessing the allocated memory. If the
+first test is skipped (by uncommenting the br line), then the test is
+passed but the interpreter crashes with a SIGSEGV.