[Mono-bugs] [Bug 81703][Nor] New - jit crashes while emitting ldc.i4.s in certain cases.

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Tue May 22 05:09:21 EDT 2007


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 rolfkvinge at ya.com.

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

--- shadow/81703	2007-05-22 05:09:21.000000000 -0400
+++ shadow/81703.tmp.31518	2007-05-22 05:09:21.000000000 -0400
@@ -0,0 +1,101 @@
+Bug#: 81703
+Product: Mono: Runtime
+Version: 1.0
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: JIT
+AssignedTo: lupus at ximian.com                            
+ReportedBy: rolfkvinge at ya.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: jit crashes while emitting ldc.i4.s in certain cases.
+
+The following vb code when jitted crashes on ia64.
+
+Class ia64_1
+	Shared Sub Main
+		EmitLoadI4Value (2)
+	End Sub
+	Shared Sub EmitLoadI4Value(ByVal I As Integer)
+		If I >= SByte.MinValue AndAlso I <= SByte.MaxValue Then
+		End If
+    	End Sub
+End Class
+
+The corresponding IL:
+.method public static void EmitLoadI4Value(int8 I) cil managed
+{
+    .maxstack 8
+    L_0000: ldarg.0 
+    L_0001: ldc.i4.s -128
+    L_0003: clt 
+    L_0005: ldc.i4.0 
+    L_0006: ceq 
+    L_0008: brfalse L_001a
+    L_000d: ldarg.0 
+    L_000e: ldc.i4.s 127
+    L_0010: cgt 
+    L_0012: ldc.i4.0 
+    L_0013: ceq 
+    L_0015: brtrue L_0020
+    L_001a: ldc.i4.0 
+    L_001b: br L_0021
+    L_0020: ldc.i4.1 
+    L_0021: brfalse L_002b
+    L_0026: br L_002b
+    L_002b: ret 
+}
+
+ 
+Repro: 
+vbnc ia64_1.vb
+mono --compile ia64_1:EmitLoadI4Value
+
+Output:
+** ERROR **: file mini-ia64.c: line 2671 (mono_arch_output_basic_block): 
+assertion failed: ((((gint64)((((ins->data.op[1].const_val) - 1))) >= -
+128) && ((gint64)((((ins->data.op[1].const_val) - 1))) <= 127)))
+aborting...
+Stacktrace:
+
+
+Native stacktrace:
+
+        mono [0x4000000000282050]
+        [0xa0000000000107e0]
+        [0xa000000000010641]
+        /lib/tls/libc.so.6.1(gsignal+0xd0) [0x20000000001e8650]
+        /lib/tls/libc.so.6.1(abort+0x2d0) [0x20000000001eadb0]
+        /opt/gnome/lib/libglib-2.0.so.0(g_logv+0x420) [0x20000000000cbe10]
+        /opt/gnome/lib/libglib-2.0.so.0(g_log+0x70) [0x20000000000cc2c0]
+        mono [0x40000000000738e0]
+        mono [0x4000000000218a10]
+        mono [0x400000000024e5c0]
+        mono(mono_main+0x1a10) [0x4000000000019940]
+        mono [0x40000000000172c0]
+        /lib/tls/libc.so.6.1(__libc_start_main+0x3d0) [0x20000000001c1810]
+        mono [0x4000000000017100]
+
+Debug info from gdb:
+
+
+
+=================================================================
+Got a SIGABRT while executing native code. This usually indicates
+a fatal error in the mono runtime or one of the native libraries
+used by your application.
+=================================================================
+
+Notes:
+- PEVerify doesn't complain about the IL.
+- I couldn't make mcs generate this IL (it uses ldc.i4 for these numbers), 
+so no C# sample.
+- In EmitLoadI4Value both conditions have to be present, and the variable 
+has to be a method parameter (tried changing it to a local and it works).
+- The parameter can be both a sbyte as well as an integer, both crashes.


More information about the mono-bugs mailing list