Bug 462553 - -mpreferred-stack-boundary=2 on 32 bit x86 causes crashes when SSE is also enabled (e.g. used by glibc)
Summary: -mpreferred-stack-boundary=2 on 32 bit x86 causes crashes when SSE is also en...
Status: REPORTED
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.20.0
Platform: Other Linux
: NOR crash
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-02 16:33 UTC by Alexander Kanavin
Modified: 2023-10-12 15:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Kanavin 2022-12-02 16:33:05 UTC
Valgrind build itself with -mpreferred-stack-boundary=2 on x86 (32 bit) targets. On the other hand,  SSE instructions expect things to be aligned on 16 byte boundary (e.g. -mpreferred-stack-boundary=4). This won't be reported at compile time and results in crashes at runtime, e.g. vgdb simply does not work at all and crashes out immediately when calling into glibc code which moves things to and from XMM registers (because it was built with SSE enabled).
Comment 1 Paul Floyd 2022-12-05 09:07:36 UTC
What platform / glibc version is this with?
Comment 2 Alexander Kanavin 2022-12-05 09:55:10 UTC
Yocto/qemux86. We use the following flags across the stack:

-march=core2 -mtune=core2 -msse3 -mfpmath=sse

glibc is at 2.36.