Commit Graph

4 Commits

Author SHA1 Message Date
David Xu
d3c6a920f1 1. Use correct alignment mask, -15 != ~15
2. Make end of frames
2004-07-31 01:41:41 +00:00
Peter Wemm
3726033348 Fix Yet Another 16 byte stack alignment bug. Thankfully, this one is
solved by a simple 'make world'.  The signalcontext function was going
to the trouble of generating an even 16 byte alignment, but in fact it
needed to be odd aligned to simulate the 8-byte return address having
been pushed by the caller.  This fixes yet another group of crashes in
applications using libpthread.  And yet again, it was my fault all along.

While here, rename the duplicate internal ctx_wrapper() functions to
makectx_wrapper() and sigctx_wrapper() so that traces aren't ambiguous.
2004-03-31 07:27:31 +00:00
Peter Wemm
04cb6b3aa6 "Fix" makecontext() so that the C code begins execution with its
ABI-required stack alignment.  C code expects that the push of the
return address disturbed the 16 byte alignment and it will take corrective
measures to fix it before making another call.  Of course, if its wrong
to start with, then all hell breaks loose.  Essentially we "fix" this
by making the stack alignment odd to start with.

This was one of the things that broke on libkse with apps that use
floating point/varargs/etc.

Approved by:  re (scottl)
2003-12-05 01:36:44 +00:00
Daniel Eischen
4adc354c34 Add amd64 versions of makecontext() and signalcontext() needed
for libkse (makecontext() is also needed for libthr).
These probably will need some tweaking.
2003-07-19 04:41:08 +00:00