[Mono-bugs] [Bug 23778] New - the jit miscompiles Thread::Finalize()

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
23 Apr 2002 15:48:29 -0000


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=23778

--- shadow/23778	Tue Apr 23 11:48:29 2002
+++ shadow/23778.tmp.23148	Tue Apr 23 11:48:29 2002
@@ -0,0 +1,42 @@
+Bug#: 23778
+Product: Mono/Runtime
+Version: unspecified
+OS: other
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: lupus@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: the jit miscompiles Thread::Finalize()
+
+Running: mono --noinline --dump-asm --ncompile 1 --compile
+System.Threading.Thread:Finalize corlib.dll 
+
+we get the following output:
+00000000 <System.Threading.Thread_Finalize>:
+   0:	55                   	push   %ebp
+   1:	8b ec                	mov    %esp,%ebp
+   3:	e8 05 00 00 00       	call   d <System.Threading.Thread_Finalize+0xd>
+   8:	e9 10 00 00 00       	jmp    1d <System.Threading.Thread_Finalize+0x1d>
+   d:	8b 45 08             	mov    0x8(%ebp),%eax
+  10:	50                   	push   %eax
+  11:	8b 00                	mov    (%eax),%eax
+  13:	ff 90 20 00 00 00    	call   *0x20(%eax)
+  19:	83 c4 04             	add    $0x4,%esp
+  1c:	c3                   	ret    
+  1d:	c9                   	leave  
+  1e:	c3                   	ret    
+  1f:	90                   	nop    
+
+At offset 0x13, Object::Finalize() is called like a virtual method, so
+Thread::Finalize() is called again... resulting in a loop and a stack
+overflow. The IL code has a correct call opcode there, not callvirt.
+I was unable to reproduce the error with a simple test case that replicates
+the IL code in Thread::Finalize().