Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Romain Naour <romain.naour@gmail.com>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH] package/busybox: disable stack optimization for i386 target
Date: Thu, 11 May 2023 22:44:02 +0200	[thread overview]
Message-ID: <20230511204402.GM252090@scaer> (raw)
In-Reply-To: <20230210233658.3763549-1-romain.naour@gmail.com>

Romain, All,

On 2023-02-11 00:36 +0100, Romain Naour spake thusly:
> The toolchain-builder project reported an issue with Qemu 7.2.0 for
> x86-core2--glibc--bleeding-edge toolchain [1]:
> 
>   Run /sbin/init as init process
>   random: fast init done
>   EXT4-fs (vda): warning: mounting unchecked fs, running e2fsck is recommended
>   EXT4-fs (vda): re-mounted. Opts: (null). Quota mode: disabled.
>   Starting syslogd: OK
>   traps: syslogd[52] general protection fault ip:b7e21465 sp:bfe59e6c error:0 in libc.so.6[b7d9b000+123000]
>   Starting klogd: OK
>   traps: klogd[56] general protection fault ip:b7e94465 sp:bf8f069c error:0 in libc.so.6[b7e0e000+123000]
>   Running sysctl: traps: logger[62] general protection fault ip:b7e48b6c sp:bfd7d194 error:0 in libc.so.6[b7e05000+123000]
>   Segmentation fault
>   traps: logger[64] general protection fault ip:b7dd3b6c sp:bf9b8604 error:0 in libc.so.6[b7d90000+123000]
>   Segmentation fault
> 
>   (Followed by a kernel panic.)
> 
> Testing with the pevious Qemu release (7.1.0) allows to boot the system without any problem.
> 
> Building qemu sources between 7.1.0 and 7.2.0 allows to identify the first "bad" commit [2] and
> report to the Qemu project [3].
> 
> Thanks to Qemu maintainers review, several issues was noticed:
> 
>   "The default i386 busybox build config does not respect glibc's requirements around stack alignment
>   (see [4] for previous discussions and a workaround)."
> 
> Disabling CONFIG_STACK_OPTIMIZATION_386 option (as suggested in the Gentoo bug report) fixed the issue!
> 
> This option has been added and enabled by default in buxybox 1_29_0, so it was used since then the for
> Buildroot's qemu defconfig.
> 
> Note: The x86-i686--glibc--bleeding-edge (generic x86) doesn't trigger the issue with
> CONFIG_STACK_OPTIMIZATION_386 enabled.
> 
> Fixes:
> https://gitlab.com/buildroot.org/toolchains-builder/-/jobs/3731683337
> 
> [1] https://gitlab.com/buildroot.org/toolchains-builder/-/jobs/3731683337
> [2] https://gitlab.com/qemu-project/qemu/-/commit/958e1dd1300f37f18b2161dfb4eb806fc8c19b44
> [3] https://gitlab.com/qemu-project/qemu/-/issues/1478
> [4] https://bugs.gentoo.org/725674
> 
> Signed-off-by: Romain Naour <romain.naour@gmail.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
>  package/busybox/busybox-minimal.config | 2 +-
>  package/busybox/busybox.config         | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/busybox/busybox-minimal.config b/package/busybox/busybox-minimal.config
> index 1fb4e39e21..1e7ad1d357 100644
> --- a/package/busybox/busybox-minimal.config
> +++ b/package/busybox/busybox-minimal.config
> @@ -53,7 +53,7 @@ CONFIG_EXTRA_CFLAGS=""
>  CONFIG_EXTRA_LDFLAGS=""
>  CONFIG_EXTRA_LDLIBS=""
>  # CONFIG_USE_PORTABLE_CODE is not set
> -CONFIG_STACK_OPTIMIZATION_386=y
> +# CONFIG_STACK_OPTIMIZATION_386 is not set
>  CONFIG_STATIC_LIBGCC=y
>  
>  #
> diff --git a/package/busybox/busybox.config b/package/busybox/busybox.config
> index 4826fb8242..6e8bd2799d 100644
> --- a/package/busybox/busybox.config
> +++ b/package/busybox/busybox.config
> @@ -53,7 +53,7 @@ CONFIG_EXTRA_CFLAGS=""
>  CONFIG_EXTRA_LDFLAGS=""
>  CONFIG_EXTRA_LDLIBS=""
>  # CONFIG_USE_PORTABLE_CODE is not set
> -CONFIG_STACK_OPTIMIZATION_386=y
> +# CONFIG_STACK_OPTIMIZATION_386 is not set
>  CONFIG_STATIC_LIBGCC=y
>  
>  #
> -- 
> 2.34.3
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2023-05-11 20:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 23:36 [Buildroot] [PATCH] package/busybox: disable stack optimization for i386 target Romain Naour
2023-02-11  9:49 ` Thomas Petazzoni via buildroot
2023-02-11 10:10   ` Romain Naour
2023-05-10 10:06     ` Romain Naour
2023-06-12 20:16       ` Peter Korsgaard
2023-05-11 20:44 ` Yann E. MORIN [this message]
2023-05-11 20:49   ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230511204402.GM252090@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=romain.naour@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox