Re: AMD64: stack alignment
Claus Assmann <[email protected]> Wed, 18 Dec 2013 07:55:25 -0800
| Newsgroups | gmane.comp.lib.state-threads.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Dec 18, 2013, Michael Abbott wrote:
> Your patch changes the stack base from being 64-byte aligned to
> being only 8-byte aligned which seems backwards and could break
> other code. I'm afraid I won't adopt your patch into the ST
I have to admit I'm confused by the alignment issue too, but the
ABI for AMD64 states:
=== http://x86-64.org/documentation/abi.pdf (page 17) ===
3.2.2 The Stack Frame
...
The end of the input argument area shall be aligned on a 16 (32, if __m256
is passed on stack) byte boundary. In other words, the value (%rsp + 8) is
always a multiple of 16 (32) when control is transferred to the function entry
point. The stack pointer, %rsp, always points to the end of the latest allocated
stack frame.
=== cut ===
So this means rsp % 16 == 8 on function entry, but this is not the case
in the debug output (it's rsp % 16 == 0 which looked fine to me until
someone pointed me to the ABI).
Do you have a program for statethreads that uses OpenSSL 1.0.1e
on amd64 with asm code for SHA1?
Maybe I can try to write a small test program (currently it's the
MeTA1 smtp server that triggers the problem) if you would be
interested in looking into this.
PS: the patch that I attached is wrong for FreeBSD as it changes
the stack layout for i386 too (and it is against my MeTA1 version,
not the original 1.9). That was not intended.
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk