[Mono-bugs] [Bug 404729] New: Exception when marshaling struct return values on Linux64

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jun 27 18:18:08 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=404729


           Summary: Exception when marshaling struct return values on
                    Linux64
           Product: Mono: Runtime
           Version: SVN
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: JIT
        AssignedTo: lupus at novell.com
        ReportedBy: billholmes54 at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


To reproduce compile the attached files.

gcc test.c -m64 -shared -rdynamic -fPIC -g -o libtest.so
gmcs cstest.cs

run
mono cstest.exe

I believe that the problem is that after the arguments are loaded in the
correct registers and pushed on then stack the address of a dummy variable is
pushed on the stack.  This causes arguments > 6 to be invalid.

0x0000000040010380:     push   %rbp
0x0000000040010381:     mov    %rsp,%rbp
0x0000000040010384:     sub    $0x90,%rsp
0x000000004001038b:     mov    %rbx,0xffffffffffffffc8(%rbp)
0x000000004001038f:     mov    %rbp,0xffffffffffffffd0(%rbp)
0x0000000040010393:     mov    %r12,0xffffffffffffffe0(%rbp)
0x0000000040010397:     mov    %r13,0xffffffffffffffe8(%rbp)
0x000000004001039b:     mov    %r14,0xfffffffffffffff0(%rbp)
0x000000004001039f:     mov    %r15,0xfffffffffffffff8(%rbp)
0x00000000400103a3:     mov    %rdi,0xffffffffffffffa0(%rbp)
0x00000000400103a7:     mov    %rsi,0xffffffffffffff78(%rbp)
0x00000000400103ae:     mov    %rdx,0xffffffffffffff70(%rbp)
0x00000000400103b5:     mov    %rcx,%rbx
0x00000000400103b8:     mov    %r8,%r12
0x00000000400103bb:     mov    %r9,%r13
0x00000000400103be:     mov    0x10(%rbp),%r14
0x00000000400103c2:     mov    0x18(%rbp),%r15
0x00000000400103c6:     mov    %fs:0xfffffffffffffff8,%rax
0x00000000400103cf:     mov    %rax,0xffffffffffffffa8(%rbp)
0x00000000400103d3:     lea    0xffffffffffffffa8(%rbp),%r11
0x00000000400103d7:     mov    %r11,%fs:0xfffffffffffffff8
0x00000000400103e0:     movb   $0x0,0xffffffffffffff90(%rbp)
0x00000000400103e4:     sub    $0x8,%rsp
0x00000000400103e8:     push   %r15
0x00000000400103ea:     mov    %r14,%r9
0x00000000400103ed:     mov    %r13,%r8
0x00000000400103f0:     mov    %r12,%rcx
0x00000000400103f3:     mov    %rbx,%rdx
0x00000000400103f6:     movslq 0xffffffffffffff70(%rbp),%rsi
0x00000000400103fd:     movslq 0xffffffffffffff78(%rbp),%rdi
0x0000000040010404:     mov    %rsp,0xffffffffffffffd8(%rbp)
0x0000000040010408:     mov    $0x2a98ebc65c,%rax
0x0000000040010412:     lea    0xffffffffffffff98(%rbp),%r10
0x0000000040010416:     push   %r10
0x0000000040010418:     sub    $0x8,%rsp
0x000000004001041c:     callq  *%eax
0x000000004001041e:     add    $0x10,%rsp
0x0000000040010422:     add    $0x8,%rsp
0x0000000040010426:     pop    %rcx
0x0000000040010427:     mov    %rax,(%rcx)
0x000000004001042a:     movsbq 0xffffffffffffff98(%rbp),%rax
0x000000004001042f:     mov    %al,0xffffffffffffff90(%rbp)
0x0000000040010433:     mov    0xffffffffffffffa0(%rbp),%rax
0x0000000040010437:     movsbq 0xffffffffffffff90(%rbp),%rcx
0x000000004001043c:     mov    %cl,(%rax)
0x000000004001043f:     mov    0xffffffffffffffa8(%rbp),%r11
0x0000000040010443:     mov    %r11,%fs:0xfffffffffffffff8
0x000000004001044c:     mov    0xffffffffffffffc8(%rbp),%rbx
0x0000000040010450:     mov    0xffffffffffffffe0(%rbp),%r12
0x0000000040010454:     mov    0xffffffffffffffe8(%rbp),%r13
0x0000000040010458:     mov    0xfffffffffffffff0(%rbp),%r14
0x000000004001045c:     mov    0xfffffffffffffff8(%rbp),%r15
0x0000000040010460:     leaveq
0x0000000040010461:     retq


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list