[Mono-bugs] [Bug 59750][Nor] Changed - test-269 - varargs problem

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 8 Jun 2004 00:47:38 -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 martin@ximian.com.

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

--- shadow/59750	2004-06-08 00:43:57.000000000 -0400
+++ shadow/59750.tmp.29976	2004-06-08 00:47:38.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 59750
 Product: Mono: Runtime
 Version: unspecified
-OS: 
+OS: unknown
 OS Details: 
 Status: NEW   
 Resolution: 
-Severity: 
+Severity: Unknown
 Priority: Normal
 Component: misc
 AssignedTo: mono-bugs@ximian.com                            
 ReportedBy: martin@ximian.com               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
@@ -20,6 +20,81 @@
 
 When invoking a varargs method which has normal arguments, like this:
    int AddABunchOfInts(int a, __arglist)
 mini incorrectly computes the start address of the variable arguments.
 
 The same binary runs fine on the MS runtime.
+
+------- Additional Comments From martin@ximian.com  2004-06-08 00:47 -------
+Process @3 stopped at #0: 0x401ac452 in
+Class1.Main(System.String[])+0x12 at /home/martin/work/E.cs:22.
+  22 		int result = AddABunchOfInts (8, __arglist ( 2, 3, 4 ));
+(mdb) dis -method
+Class1.Main(System.String[]):
+0x401ac440	push   %ebp
+0x401ac441	mov    %esp,%ebp
+0x401ac443	push   %ebx
+0x401ac444	push   %edi
+0x401ac445	push   %esi
+0x401ac446	call   0x80492f0
+0x401ac44b	mov    %eax,%edi
+0x401ac44d	mov    $0x0,%esi
+0x401ac452	push   $0x4
+0x401ac457	push   $0x3
+0x401ac45c	push   $0x2
+0x401ac461	push   $0x8
+0x401ac466	push   $0x82b5638
+0x401ac46b	call   Class1.AddABunchOfInts(System.Int32)
+mdb) i
+Process @3 stopped at #0: 0x401ac457 in
+Class1.Main(System.String[])+0x17 at /home/martin/work/E.cs:22.
+  22 		int result = AddABunchOfInts (8, __arglist ( 2, 3, 4 ));
+0x401ac457	push   $0x3
+(mdb) 
+Process @3 stopped at #0: 0x401ac45c in
+Class1.Main(System.String[])+0x1c at /home/martin/work/E.cs:22.
+  22 		int result = AddABunchOfInts (8, __arglist ( 2, 3, 4 ));
+0x401ac45c	push   $0x2
+(mdb) 
+Process @3 stopped at #0: 0x401ac461 in
+Class1.Main(System.String[])+0x21 at /home/martin/work/E.cs:22.
+  22 		int result = AddABunchOfInts (8, __arglist ( 2, 3, 4 ));
+0x401ac461	push   $0x8
+(mdb) 
+Process @3 stopped at #0: 0x401ac466 in
+Class1.Main(System.String[])+0x26 at /home/martin/work/E.cs:22.
+  22 		int result = AddABunchOfInts (8, __arglist ( 2, 3, 4 ));
+0x401ac466	push   $0x82b5638
+(mdb) 
+Process @3 stopped at #0: 0x401ac46b in
+Class1.Main(System.String[])+0x2b at /home/martin/work/E.cs:22.
+  22 		int result = AddABunchOfInts (8, __arglist ( 2, 3, 4 ));
+0x401ac46b	call   Class1.AddABunchOfInts(System.Int32)
+(mdb) p %esp
+0x40bb0858
+(mdb) s
+** Message: mono-debug-debugger.c:951: System.TypedReference -
+0x81c0298 - 22
+** Message: mono-debug-debugger.c:951: System.TypedReference -
+0x81c0298 - 22
+** Message: mono-debug-debugger.c:951: System.TypedReference -
+0x81c0298 - 22
+Process @3 stopped at #0: 0x401ac589 in
+Class1.AddABunchOfInts(System.Int32)+0x21 at /home/martin/work/E.cs:7.
+   7 		int result = 0;
+(mdb) s
+Process @3 stopped at #0: 0x401ac58e in
+Class1.AddABunchOfInts(System.Int32)+0x26 at /home/martin/work/E.cs:9.
+   9 		System.ArgIterator iter = new System.ArgIterator (__arglist);
+(mdb) s
+Process @3 stopped at #0: 0x401ac6fe in
+System.ArgIterator..ctor(System.RuntimeArgumentHandle)+0x26 at
+/home/martin/monocvs/mcs/class/corlib/System/ArgIterator.cs:27.
+  27 			sig = IntPtr.Zero;
+(mdb) show params
+$arglist = (System.RuntimeArgumentHandle) {0x40bb0858}
+
+
+Here's the problem.  At 0x40bb0858 on the stack is the method
+signature, followed by the 0x8 followed by the varargs 0x2,0x3,0x4.
+However, the ArgIterator thinks the arguments immediately follow the
+signature.