Bug 15491 - segmentation fault in busybox/glibc due to CONFIG_STACK_OPTIMIZATION_386
Summary: segmentation fault in busybox/glibc due to CONFIG_STACK_OPTIMIZATION_386
Status: RESOLVED MOVED
Alias: None
Product: buildroot
Classification: Unclassified
Component: Other (show other bugs)
Version: 2023.02
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-25 21:10 UTC by Felix Schmidt
Modified: 2024-06-15 15:07 UTC (History)
2 users (show)

See Also:
Host: Embedded Atom CE2752
Target: i686-buildroot-linux-gnu
Build: Linux x86


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Felix Schmidt 2023-03-25 21:10:12 UTC
Hi,

i was facing the issue that busybox (ls appled) was generating a random segmentation fault in libc/ctime() (i386 platform, glibc 2.30).
The actual problem was that CONFIG_STACK_OPTIMIZATION_386 was set by default, causing an 8 byte aligned stack, and glibc uses a movaps instruction on it (which requires 16 byte alignment).

Obviously i could solve this by disabling CONFIG_STACK_OPTIMIZATION_386, but it took me quite a while to find it out.

This really should be disabled by default. After some digging it seems that the ABI nowadays mandates 16 byte stack alignment even for i386 (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38496).
Comment 1 Thomas Petazzoni 2023-03-26 12:15:47 UTC
See also this patch and the discussion: https://patchwork.ozlabs.org/project/buildroot/patch/20230210233658.3763549-1-romain.naour@gmail.com/
Comment 2 Yann E. MORIN 2024-06-15 15:07:35 UTC
Thank you for your report.

The issue tracker for the Buildroot project has been moved to
the Gitlab.com issue tracker:
    https://gitlab.com/buildroot.org/buildroot/-/issues

We are taking this opportunity to close old issues in this old
tracker. If you believe your issue is still relevant, please
open one in the new issue tracker.

Thank you!