This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/20596] sprintf segmentation fault due to misaligned movaps on x86_64


https://sourceware.org/bugzilla/show_bug.cgi?id=20596

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING

--- Comment #3 from Florian Weimer <fweimer at redhat dot com> ---
Yes, test_onPointChange is miscompiled.  It moves rsp by 8 + 24 bytes, so the
stack pointer is not a multiple of 16 at the point of the callq instruction.

(gdb) disassemble test_onPointChange
Dump of assembler code for function test_onPointChange:
   0x0000000000400629 <+0>:     push   %rbp
   0x000000000040062a <+1>:     mov    %rsp,%rbp
   0x000000000040062d <+4>:     sub    $0x18,%rsp
   0x0000000000400631 <+8>:     mov    %rdi,-0x8(%rbp)
   0x0000000000400635 <+12>:    mov    %rsi,-0x10(%rbp)
   0x0000000000400639 <+16>:    mov    %rdx,-0x18(%rbp)
   0x000000000040063d <+20>:    mov    $0x0,%edx
   0x0000000000400642 <+25>:    mov    $0x0,%esi
   0x0000000000400647 <+30>:    mov    $0x0,%edi
   0x000000000040064c <+35>:    callq  0x4006dd <APP_PointChangeHandler>
   0x0000000000400651 <+40>:    nop
   0x0000000000400652 <+41>:    leaveq 
   0x0000000000400653 <+42>:    retq   
End of assembler dump.

It seems that GCC incorrectly assumes that APP_PointChangeHandler is a local
function and does not need stack alignment.

Andrew, do you have an account in GCC Bugzilla and can report it there? 
Thanks.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]