[Mesa-dev] [Bug 87658] [llvmpipe] SEGV in sse2_has_daz on ancient Pentium4-M

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Dec 29 03:35:08 PST 2014


https://bugs.freedesktop.org/show_bug.cgi?id=87658

--- Comment #17 from ubizjak at gmail.com ---
(In reply to Patrick Baggett from comment #16)
> That is strange...I would have expected an "illegal instruction" (SIGILL) if
> the CPU simply did not support this, but this is SIGSEGV. Is the 'fxsave'
> struct really aligned properly? It looks like should be...but it is still
> giving SIGSEGV. Can you print the 'fxsave' address when it crashes?

As said above, with 32bit gcc, you need to decorate the function with

'force_align_arg_pointer'
     On the Intel x86, the 'force_align_arg_pointer' attribute may be
     applied to individual function definitions, generating an alternate
     prologue and epilogue that realigns the run-time stack if
     necessary.  This supports mixing legacy codes that run with a
     4-byte aligned stack with modern codes that keep a 16-byte stack
     for SSE compatibility.

"New" x86_32 ABI mandates 16-byte stack alignment, and the above attribute
forces realignment of the incoming stack pointer. Maybe there is a hand-crafted
assembly code in the MESA source, libc or somewhere else (that conforms to
"old" x86_32 ABI with 4-byte stack alignment) that misaligns the SP.

Alternatively, you can use posix_memalign, aligned_alloc or similar function to
allocate aligned memory.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20141229/31524a1a/attachment.html>


More information about the mesa-dev mailing list