Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
For now, this just tests stack alignment in a context's entry point This test shows a problem when building on i386 with `-msse2`, where the compiler is allowed use some instructions that move data in and out of the xmm0-7 registers, requiring them to be aligned on 16-byte boundaries. Because the compiler will generally assume the stack is correctly aligned on entering a function, the misalignment will propagate through the stack until something uses an instruction that requires 16-byte alignment, and we get a segmentation fault. The misalignment happens because the stack is heap-allocated (and the heap allocator provides a properly aligned pointer), but we push the argument for the async task onto the stack as we call it, leaving the stack 4 bytes below proper alignment. The test is equally valid on x86_64, but the stack alignment is correct there - nothing is pushed onto the stack prior to calling the task function, as it's passed in a register.
- Loading branch information