Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 956676 - sys-libs/musl-1.2.5-r3 [gcc 15] - musl segfaults on ppc/ppc64 after being built with GCC 15
Summary: sys-libs/musl-1.2.5-r3 [gcc 15] - musl segfaults on ppc/ppc64 after being bui...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal
Assignee: Anthony Basile
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: musl-porting gcc-15
  Show dependency tree
 
Reported: 2025-05-26 22:21 UTC by ernsteiswuerfel
Modified: 2025-05-31 04:54 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log.xz (ppc64, 1.2.5-r3) (musl-1.2.5-r3:0250526-151208.log.xz,23.26 KB, application/x-xz)
2025-05-26 22:21 UTC, ernsteiswuerfel
Details
emerge --info (file_956676.txt,6.83 KB, text/plain)
2025-05-26 22:21 UTC, ernsteiswuerfel
Details
build.log.xz (ppc64, 9999, gcc-15.1.1_p20250524) (musl-9999:20250527-105919.log.xz,23.25 KB, application/x-xz)
2025-05-27 11:17 UTC, ernsteiswuerfel
Details
build.log.xz (ppc64, 9999, clang-20.1.5) (musl-9999:20250527-111108.log.xz,22.05 KB, application/x-xz)
2025-05-27 11:38 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2025-05-26 22:21:12 UTC
Created attachment 929696 [details]
build.log.xz (ppc64, 1.2.5-r3)

musl-1.2.5-r3 builds fine with GCC 15 on ppc/ppc64 but segfaults immediately after installed. Which leaves the system unusable as every other command segfaults too.

Also tried musl-9999, but with the same effect:

[...]
>>> Completed installing sys-libs/musl-1.2.5-r3 into /var/tmp/portage/sys-libs/musl-1.2.5-r3/image

 * Final size of build directory: 22676 KiB (22.1 MiB)
 * Final size of installed tree:   5232 KiB ( 5.1 MiB)

strip: powerpc64-unknown-linux-musl-strip --strip-unneeded -N __gentoo_check_ldflags__ -R .comment -R .GCC.command.line -R .note.gnu.gold-version
   /usr/lib/Scrt1.o
   /usr/lib/crti.o
   /usr/lib/crt1.o
   /usr/lib/rcrt1.o
   /usr/lib/crtn.o
   /usr/lib/libm.a
   /usr/lib/librt.a
   /usr/lib/libpthread.a
   /usr/lib/libutil.a
   /usr/lib/libxnet.a
   /usr/lib/libresolv.a
   /usr/lib/libc.so
   /usr/lib/libdl.a
   /usr/lib/libc.a
   /usr/bin/getconf
   /usr/bin/getent
   /usr/bin/iconv
   /usr/lib/libssp_nonshared.a
!!! FAILED prerm: -11
 * The ebuild phase 'postrm' has been killed by signal 11.
 * The ebuild phase 'die_hooks' has been killed by signal 11.
!!! FAILED postrm: 1
 * The 'postrm' phase of the 'sys-libs/musl-1.2.5-r3' package has failed
 * with exit value 1.
 * 
 * The problem occurred while executing the ebuild file named
 * 'musl-1.2.5-r3.ebuild' located in the '/var/db/pkg/sys-
 * libs/musl-1.2.5-r3' directory. If necessary, manually remove the
 * environment.bz2 file and/or the ebuild file located in that directory.
 * 
 * Removal of the environment.bz2 file is preferred since it may allow the
 * removal phases to execute successfully. The ebuild will be sourced and
 * the eclasses from the current ebuild repository will be used when
 * necessary. Removal of the ebuild file will cause the pkg_prerm() and
 * pkg_postrm() removal phases to be skipped entirely.
!!! ldconfig was killed with signal 11
 * The ebuild phase 'postinst' has been killed by signal 11.
 * The ebuild phase 'die_hooks' has been killed by signal 11.
 * FAILED postinst: 1
!!! ldconfig was killed with signal 11
 * The ebuild phase 'other' has been killed by signal 11.
Comment 1 ernsteiswuerfel archtester 2025-05-26 22:21:46 UTC
Created attachment 929697 [details]
emerge --info
Comment 2 ernsteiswuerfel archtester 2025-05-26 22:31:52 UTC
I uploaded the build dir to: https://limewire.com/d/FzjIm#Ox2fu5biGm

With 3,3 MB tar.xz compressed it was too big to be attached here.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-26 23:01:23 UTC
One interesting thing here: why didn't the sanity check I added a little while ago help here?
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-27 06:55:20 UTC
Per your log, it didn't run at all..
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-27 06:56:11 UTC
(In reply to Sam James from comment #4)
> Per your log, it didn't run at all..

Can you try changing the ebuild like this, and give me a new build.log?

--- a/sys-libs/musl/musl-9999.ebuild
+++ b/sys-libs/musl/musl-9999.ebuild
@@ -238,7 +238,7 @@ pkg_preinst() {
        mkdir -p "${EROOT}"/etc/ld.so.conf.d

        [[ -n ${ROOT} ]] && return 0
-       [[ -d ${ED}/$(get_libdir) ]] || return 0
+       [[ -d ${ED}/usr/$(get_libdir) ]] || return 0
        musl_sanity_check
 }
Comment 6 ernsteiswuerfel archtester 2025-05-27 11:17:24 UTC
Created attachment 929785 [details]
build.log.xz (ppc64, 9999, gcc-15.1.1_p20250524)

With the patched musl-9999 your sanity check kicks in now! :)
Comment 7 ernsteiswuerfel archtester 2025-05-27 11:38:47 UTC
Created attachment 929786 [details]
build.log.xz (ppc64, 9999, clang-20.1.5)

Building musl-9999 with clang-20.1.5 fails in a similar way with segfaults but does not break the system as badly as with GCC 15 (shell commands still work):

[...]
>>> Installing (1 of 1) sys-libs/musl-9999::gentoo
 * Last-minute run tests with ./libc.so in /usr/lib ...
Updating links is not implemented.
Sandboxed process killed by signal: Segmentation fault
 * The ebuild phase 'postinst' has been killed by signal 11.
!!! post postinst failed; exiting.
Sandboxed process killed by signal: Segmentation fault
 * The ebuild phase 'die_hooks' has been killed by signal 11.
 * FAILED postinst: 1
Sandboxed process killed by signal: Segmentation fault
 * The ebuild phase 'other' has been killed by signal 11.

>>> Completed (1 of 1) sys-libs/musl-9999::gentoo

>>> Failed to install sys-libs/musl-9999, Log file:

>>>  '/var/log/portage/build/sys-libs/musl-9999:20250527-111108.log'

 * Messages for package sys-libs/musl-9999:
 * Log file: /var/log/portage/build/sys-libs/musl-9999:20250527-111108.log

 * The ebuild phase 'postinst' has been killed by signal 11.
 * FAILED postinst: 1
 * The ebuild phase 'other' has been killed by signal 11.


And the broken clang-20.1.5 build still manages to slip through the sanity check somehow.
Comment 8 ernsteiswuerfel archtester 2025-05-27 11:42:40 UTC
dmesg shows:

[  772.344290] libc.so[10693]: segfault (11) at 10 nip 3fff88d5a538 lr 3fff88d5a52c code 1 in libc.so[4a538,3fff88d10000+d0000]
[  772.344313] libc.so[10693]: code: 7ba90fa4 7d5eb850 7d3a4a2e 39290001 793b22e8 553f2036 7c2ad840 41800090 
[  772.344319] libc.so[10693]: code: 480005f1 60000000 7baaa18a 393fffec <fbc30010> 92c30018 9303001c f87e0000 
[ 1047.309773] CIFS: enabling forceuid mount option implicitly because uid= option is specified
[ 1047.309781] CIFS: enabling forcegid mount option implicitly because gid= option is specified
[ 1047.309785] CIFS: Attempting to mount //192.168.2.3/yea_home
[ 1959.217681] misc-functions.[17095]: segfault (11) at 7fff0000 nip 7fff0000 lr 7fff0001 code 1
[ 1959.217714] misc-functions.[17095]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 1959.217731] misc-functions.[17095]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 1959.341593] misc-functions.[17097]: segfault (11) at 7fff0000 nip 7fff0000 lr 7fff0001 code 1
[ 1959.341620] misc-functions.[17097]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 1959.341638] misc-functions.[17097]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 1960.291674] misc-functions.[17107]: segfault (11) at 7fff0000 nip 7fff0000 lr 7fff0001 code 1
[ 1960.291706] misc-functions.[17107]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 1960.291724] misc-functions.[17107]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 2528.673905] misc-functions.[17425]: segfault (11) at 7fff0000 nip 7fff0000 lr 7fff0001 code 1
[ 2528.673938] misc-functions.[17425]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 2528.673955] misc-functions.[17425]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 2528.808372] misc-functions.[17428]: segfault (11) at 7fff0000 nip 7fff0000 lr 7fff0001 code 1
[ 2528.808402] misc-functions.[17428]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 2528.808419] misc-functions.[17428]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 2528.931831] misc-functions.[17430]: segfault (11) at 7fff0000 nip 7fff0000 lr 7fff0001 code 1
[ 2528.931858] misc-functions.[17430]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 
[ 2528.931875] misc-functions.[17430]: code: XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX XXXXXXXX 


Segfaults before the CIFS mount are from the GCC 15 build, after the mount from the CLANG 20 build and the attempt of restoring the backup via:

 # emerge -1K musl
Calculating dependencies... done!
Dependency resolution took 9.08 s (backtrack: 0/20).


>>> Emerging binary (1 of 1) sys-libs/musl-1.2.5-r3::gentoo
 * musl-1.2.5-r3.tbz2 MD5 SHA1 size ;-) ...                              [ ok ]
>>> Extracting info
>>> Extracting sys-libs/musl-1.2.5-r3

>>> Installing (1 of 1) sys-libs/musl-1.2.5-r3::gentoo
Sandboxed process killed by signal: Segmentation fault
 * The ebuild phase 'instprep' has exited unexpectedly. This type of
 * behavior is known to be triggered by things such as failed variable
 * assignments (bug #190128) or bad substitution errors (bug #200313).
 * Normally, before exiting, bash should have displayed an error message
 * above. If bash did not produce an error message above, it's possible
 * that the ebuild has called `exit` when it should have called `die`
 * instead. This behavior may also be triggered by a corrupt bash binary or
 * a hardware problem such as memory or cpu malfunction. If the problem is
 * not reproducible or it appears to occur randomly, then it is likely to
 * be triggered by a hardware problem. If you suspect a hardware problem
 * then you should try some basic hardware diagnostics such as memtest.
 * Please do not report this as a bug unless it is consistently
 * reproducible and you are sure that your bash binary and hardware are
 * functioning properly.
Sandboxed process killed by signal: Segmentation fault
 * The ebuild phase 'die_hooks' has been killed by signal 11.
!!! instprep failed
Sandboxed process killed by signal: Segmentation fault
 * The ebuild phase 'other' has been killed by signal 11.

>>> Completed (1 of 1) sys-libs/musl-1.2.5-r3::gentoo

>>> Failed to install sys-libs/musl-1.2.5-r3, Log file:

>>>  '/var/log/portage/build/sys-libs/musl-1.2.5-r3:20250527-113107.log'

 * Messages for package sys-libs/musl-1.2.5-r3:
 * Log file: /var/log/portage/build/sys-libs/musl-1.2.5-r3:20250527-113107.log

 * The ebuild phase 'instprep' has exited unexpectedly. This type of
 * behavior is known to be triggered by things such as failed variable
 * assignments (bug #190128) or bad substitution errors (bug #200313).
 * Normally, before exiting, bash should have displayed an error message
 * above. If bash did not produce an error message above, it's possible
 * that the ebuild has called `exit` when it should have called `die`
 * instead. This behavior may also be triggered by a corrupt bash binary or
 * a hardware problem such as memory or cpu malfunction. If the problem is
 * not reproducible or it appears to occur randomly, then it is likely to
 * be triggered by a hardware problem. If you suspect a hardware problem
 * then you should try some basic hardware diagnostics such as memtest.
 * Please do not report this as a bug unless it is consistently
 * reproducible and you are sure that your bash binary and hardware are
 * functioning properly.
 * The ebuild phase 'other' has been killed by signal 11.

 * GNU info directory index is up-to-date.
Comment 9 Larry the Git Cow gentoo-dev 2025-05-27 12:49:41 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ed1119d67cdab7a3dae9446b76b9b238528084a9

commit ed1119d67cdab7a3dae9446b76b9b238528084a9
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-05-27 12:47:58 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-05-27 12:48:57 +0000

    sys-libs/musl: fix sanity check for merged-usr
    
    Bug: https://bugs.gentoo.org/956676
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-libs/musl/musl-1.2.5-r3.ebuild | 2 +-
 sys-libs/musl/musl-9999.ebuild     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-05-27 12:50:08 UTC
Thank you! Next quest: find some tool/binary which is definitely installed (or very likely to be) that crashes so we can extend the sanity check to catch Clang..
Comment 11 ernsteiswuerfel archtester 2025-05-27 18:16:45 UTC
There have to be some arch specific aspects too.

I don't get any segfaults with GCC 15 or CLANG 20 built musl on amd64/23.0/musl/llvm.