Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 882007 - www-client/firefox: segfault on musl with clang (gecko-profiler-82abe86554f4eece/build-script-build` (signal: 11, SIGSEGV: invalid memory reference))
Summary: www-client/firefox: segfault on musl with clang (gecko-profiler-82abe86554f4e...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Profiles (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: systemwide-clang systemwide-libcxx 915000
  Show dependency tree
 
Reported: 2022-11-19 15:07 UTC by Maciej A
Modified: 2023-10-01 06:11 UTC (History)
5 users (show)

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


Attachments
emerge -pqv '=www-client/firefox-102.5.0::gentoo (emerge-pqv,805 bytes, text/plain)
2022-11-19 15:08 UTC, Maciej A
Details
build log (build.log.xz,384.11 KB, application/x-xz)
2022-11-19 15:08 UTC, Maciej A
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej A 2022-11-19 15:07:03 UTC
I'm trying to compile firefox 102.5.0 with clang 15.0.3 on a system with musl 1.2.3.

Reproducible: Always

Steps to Reproduce:
emerge firefox
Actual Results:  
Emerge fails and in dmesg I see the following:
[ 1745.323833] perf: interrupt took too long (2529 > 2500), lowering kernel.perf_event_max_sample_rate to 78900
[ 1768.733145] build-script-bu[26051]: segfault at 1 ip 00007f5bf4b79044 sp 00007ffd2ec2a008 error 4 in libc.so[7f5bf4b22000+67000]
[ 1768.733168] Code: 75 f4 c3 cc cc cc 48 89 f8 48 83 fa 08 72 14 f7 c7 07 00 00 00 74 0c a4 48 ff ca f7 c7 07 00 00 00 75 f4 48 89 d1 48 c1 e9 03 <f3> 48 a5 83 e2 07 74 05 a4 ff ca 75 fb c3 cc cc 48 89 f8 48 29 f0


Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/amd64/17.0/musl/clang, gcc-11.3.0, musl-1.2.3, 6.0.7-x86_64-xanmod1 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.0.7-x86_64-xanmod1-x86_64-AMD_Ryzen_7_5800U_with_Radeon_Graphics-with-libc
KiB Mem:    15680504 total,   6531244 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Fri, 18 Nov 2022 22:00:01 +0000
Head commit of repository gentoo: 09ad583de42268ba3dcd10d9b1d76a6e9b11989b
Timestamp of repository gentoobr: Thu, 10 Nov 2022 20:06:18 +0000
Head commit of repository gentoobr: 607beb884b86e552cb7608e8eb9eedf0c7868205

Timestamp of repository musl: Thu, 10 Nov 2022 17:16:47 +0000
Head commit of repository musl: 0ef60ce275097b4532736951914849ac11cafeed

Timestamp of repository musl-clang: Thu, 20 Oct 2022 06:32:23 +0000
Head commit of repository musl-clang: 5ba5687024dc1cba4ebc5bbaa4398c8d04f76a5a

Timestamp of repository pf4public: Thu, 17 Nov 2022 18:31:48 +0000
Head commit of repository pf4public: 6abe3d083a301eb58bf08646bdfede5b7dcab5f4

sh dash 0.5.11.5
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-lang/perl:             5.34.1-r4::gentoo
dev-lang/python:           2.7.18_p16::gentoo, 3.10.8_p3::gentoo, 3.11.0_p2::gentoo
dev-lang/rust:             1.65.0::gentoo
dev-util/cmake:            3.24.3::gentoo
dev-util/meson:            0.63.2-r1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/openrc:           0.45.2-r1::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-devel/autoconf:        2.13-r2::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.38-r2::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           14.0.6-r1::gentoo, 15.0.3::gentoo
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.6-r1::gentoo, 15.0.3::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo, 15.0.3::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/musl:             1.2.3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts:

gentoobr
    location: /var/db/repos/gentoobr
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoobr.git
    masters: gentoo

musl
    location: /var/db/repos/musl
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/musl.git
    masters: gentoo

musl-clang
    location: /var/db/repos/musl-clang
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/musl-clang.git
    masters: musl gentoo

pf4public
    location: /var/db/repos/pf4public
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/pf4public.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Microsoft-vscode"
ADDR2LINE="llvm-addr2line"
AR="llvm-ar"
AS="clang -c"
CBUILD="x86_64-gentoo-linux-musl"
CC="clang"
CFLAGS="-O2 -fomit-frame-pointer -pipe"
CHOST="x86_64-gentoo-linux-musl"
CONFIG_PROTECT="/etc /usr/lib/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CPP="clang-cpp"
CXX="clang++"
CXXFLAGS="-O2 -fomit-frame-pointer -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -fomit-frame-pointer -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -fomit-frame-pointer -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
INSTALL_MASK="charset.alias /usr/share/locale/locale.alias"
LANG="C.UTF8"
LD="ld.lld"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed "
LINGUAS="en pl"
MAKEOPTS="-j17 --load-average 18"
NM="llvm-nm"
OBJCOPY="llvm-objcopy"
OBJDUMP="llvm-objdump"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
RANLIB="llvm-ranlib"
READELF="llvm-readelf"
RUSTFLAGS="-C target-cpu=native"
SHELL="/bin/zsh"
STRINGS="llvm-strings"
STRIP="llvm-strip"
USE="X acl alsa amd64 bzip2 clang cli crypt dri fortran iconv ipv6 libglvnd libtirpc llvm-libunwind ncurses nls nptl openmp pam pcre pulseaudio readline seccomp sound split-usr ssl test-rust unicode xattr zlib zsh-completition" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="musl" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ARFLAGS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LEX, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SIZE, YACC, YFLAGS
Comment 1 Maciej A 2022-11-19 15:08:10 UTC
Created attachment 833639 [details]
emerge -pqv '=www-client/firefox-102.5.0::gentoo
Comment 2 Maciej A 2022-11-19 15:08:46 UTC
Created attachment 833641 [details]
build log
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-20 03:33:46 UTC
Can you try to get a backtrace and figure out which exact command dies?

78[1G[K[34m20:38.15(B[m   process didn't exit successfully: `/var/notmpfs/portage/www-client/firefox-102.5.0/work/firefox_build/release/build/gecko-profiler-82abe86554f4eece/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)(B[m(B[m
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-20 03:34:39 UTC
Oh, I bet this is bug 877267, and we may need to then backport the patch.
Comment 5 Maciej A 2022-11-20 10:46:10 UTC
Producing a backtrace is harder than I thought.
The issue is actually random. I see crashes in both clang++ and rustc.
But so far I couldn't catch any of them in gdb...
Comment 6 Maciej A 2022-11-20 21:07:43 UTC
I tried to fix it by installing firefox 107...and it built successfully
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-20 21:12:45 UTC
(In reply to Maciej A from comment #5)
> Producing a backtrace is harder than I thought.
> The issue is actually random. I see crashes in both clang++ and rustc.
> But so far I couldn't catch any of them in gdb...

You can try what I did in bug 877267 (get a core file then invoke gdb) but there's not much need as I think we know the problem.
Comment 8 Joonas Niilola gentoo-dev 2022-11-21 08:35:09 UTC
Reproduced this in an empty container with clang profile, fixed by following the steps from bug 877267.
Comment 9 Larry the Git Cow gentoo-dev 2022-11-21 08:36:49 UTC
The bug has been closed via the following commit(s):

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

commit 3cd2471700b79e14de561b69be360e1e0013b982
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2022-11-21 08:35:43 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-11-21 08:36:46 +0000

    www-client/firefox: update patchset for 107.0
    
     - include the libcxx patch from 106.0.
    
    Closes: https://bugs.gentoo.org/882007
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest             | 2 +-
 www-client/firefox/firefox-107.0.ebuild | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)