Every version of Firefox since, but not including, 113.0.2 has been completely unstable when built on my musl + clang + wayland (no X11, not even xwayland) system. Unfortunately, the last working non-ESR version (113.0.2) has been removed from Portage on July 17th, 2023. :( Most commonly, Firefox fails to start up at all and outputs nothing to stdout/stderr. Sometimes, Firefox fails to start up and reports a segmentation fault: zsh: segmentation fault firefox Rarely, Firefox will briefly start up and allow browsing for a few seconds. It then crashes with output like this (although it doesn't look too helpful): [Parent 27155, IPC I/O Parent] WARNING: process 27295 exited on signal 11: file /var/tmp/portage/www-client/firefox-115.0.2/work/firefox-115.0.2/ipc/chromium/src/base/process_util_posix.cc:264 console.error: ({}) console.error: SessionStore: "The session file is invalid: TypeError: state.windows[0] is undefined" console.error: "Experiment next-generation-accessibility-engine-powering-screen-readers has unknown featureId: accessibilityCache" console.error: "Experiment next-generation-accessibility-engine-powering-screen-readers-and-other-ats-copy has unknown featureId: accessibilityCache" console.error: "Experiment next-generation-accessibility-engine-powering-screen-readers-and-other-ats-copy has unknown featureId: accessibilityCache" Exiting due to channel error. Exiting due to channel error. Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown (t=6.48762) Exiting due to channel error. Crash Annotation GraphicsCriticalError: |[C0][GFX1-]: CompositorBridgeChild receives IPC close with reason=AbnormalShutdown (t=8.18833) Exiting due to channel error. Exiting due to channel error. Reproducible: Always Steps to Reproduce: 1. Launch Firefox. 2. If step 1 succeeds, just browse a bit, it will crash soon enough. Actual Results: Firefox almost always crashes on startup or very shortly after. Expected Results: Firefox does not crash. $ emerge -pv firefox These are the packages that would be merged, in order: Calculating dependencies... done! Dependency resolution took 3.40 s. [ebuild R ~] www-client/firefox-115.0.2:rapid::gentoo USE="clang dbus gmp-autoupdate hwaccel jumbo-build openh264 pulseaudio screencast system-av1 system-harfbuzz system-icu system-jpeg (system-libevent) system-libvpx system-png system-webp wayland -X -debug -eme-free -geckodriver -hardened -jack -libproxy -lto -pgo (-selinux) -sndio (-system-python-libs) -telemetry (-valgrind) -wifi" L10N="en-CA -ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -ca-valencia -cak -cs -cy -da -de -dsb -el -en-GB -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -fur -fy -ga -gd -gl -gn -gu -he -hi -hr -hsb -hu -hy -ia -id -is -it -ja -ka -kab -kk -km -kn -ko -lij -lt -lv -mk -mr -ms -my -nb -ne -nl -nn -oc -pa -pl -pt-BR -pt-PT -rm -ro -ru -sc -sco -si -sk -sl -son -sq -sr -sv -szl -ta -te -th -tl -tr -trs -uk -ur -uz -vi -xh -zh-CN -zh-TW" 0 KiB Total: 1 package (1 reinstall), Size of downloads: 0 KiB $ emerge --info Portage 3.0.49 (python 3.11.4-final-0, default/linux/amd64/17.0/musl, gcc-12, musl-1.2.3-r7, 6.1.19-gentoo-njd x86_64) ================================================================= System uname: Linux-6.1.19-gentoo-njd-x86_64-Intel-R-_Core-TM-_i5-4250U_CPU_@_1.30GHz-with-libc KiB Mem: 3963452 total, 828528 free KiB Swap: 4194300 total, 3537300 free Timestamp of repository gentoo: Fri, 21 Jul 2023 13:00:01 +0000 Head commit of repository gentoo: 4d056ba1db8b1622678d67a6ad5f8a87ba5a1e88 Timestamp of repository musl: Thu, 20 Jul 2023 10:01:52 +0000 Head commit of repository musl: 313bcc987e84a65d13638b23ae498c03fc80b3fb sh dash 0.5.12 ld GNU ld (Gentoo 2.40 p5) 2.40.0 app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r6::gentoo dev-lang/perl: 5.36.1-r3::gentoo dev-lang/python: 3.11.4::gentoo dev-lang/rust: 1.69.0-r1::gentoo dev-util/cmake: 3.26.4-r1::gentoo dev-util/meson: 1.1.1::gentoo sys-apps/baselayout: 2.13-r1::gentoo sys-apps/openrc: 0.47.1::gentoo sys-apps/sandbox: 2.37::gentoo sys-devel/autoconf: 2.13-r7::gentoo, 2.71-r6::gentoo sys-devel/automake: 1.16.5-r1::gentoo sys-devel/binutils: 2.40-r5::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/clang: 15.0.7-r3::gentoo, 16.0.6::gentoo sys-devel/gcc: 12.3.1_p20230526::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/libtool: 2.4.7-r1::gentoo sys-devel/lld: 15.0.7::gentoo, 16.0.6::gentoo sys-devel/llvm: 15.0.7-r3::gentoo, 16.0.6::gentoo sys-devel/make: 4.4.1-r1::gentoo sys-kernel/linux-headers: 6.1::gentoo (virtual/os-headers) sys-libs/musl: 1.2.3-r7::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 volatile: False sync-rsync-extra-opts: --new-compress sync-rsync-verify-jobs: 1 sync-rsync-verify-metamanifest: yes sync-rsync-verify-max-age: 24 musl location: /var/db/repos/musl sync-type: git sync-uri: https://github.com/gentoo-mirror/musl.git masters: gentoo volatile: False njd location: /var/db/repos/njd masters: gentoo volatile: False ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="*" AR="llvm-ar" CBUILD="x86_64-gentoo-linux-musl" CC="clang" CFLAGS="-march=haswell -O2 -pipe -fomit-frame-pointer" CHOST="x86_64-gentoo-linux-musl" CONFIG_PROTECT="/etc /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" CXX="clang++" CXXFLAGS="-march=haswell -O2 -pipe -fomit-frame-pointer" DISTDIR="/var/cache/distfiles" ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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="-march=haswell -O2 -pipe -fomit-frame-pointer" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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="-march=haswell -O2 -pipe -fomit-frame-pointer" GENTOO_MIRRORS="http://distfiles.gentoo.org" INSTALL_MASK="charset.alias /usr/share/locale/locale.alias" LANG="en_CA.UTF-8" LDFLAGS="-Wl,--as-needed" LEX="reflex" MAKEOPTS="-j4" NM="llvm-nm" PKGDIR="/var/cache/binpkgs" PORTAGE_CONFIGROOT="/" PORTAGE_RSYNC_EXTRA_OPTS="--new-compress" 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" RUSTFLAGS="-C target-cpu=haswell" SHELL="/bin/zsh" USE="acl alsa amd64 bluetooth brotli bzip2 clang cli colord crypt cxx dbus dri elogind exif fdk ffmpeg flac fortran gif gles2 gles2-only gles3 gstreamer heif iconv icu idn ipv6 jpeg jpeg2k lcms libaom libedit libsamplerate libtirpc lvm lz4 lzip lzma lzo magic mp3 ncurses nls nptl ogg openmp opus pam pcre png pulseaudio readline seccomp sndfile speex split-usr ssl svg test-rust theora tiff truetype udev unicode v4l vaapi vim-syntax vorbis vpx vulkan wayland webp x264 x265 xattr xvid xxhash zip zlib zstd" 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="abm acpi aes aperfmperf apic arat arch_perfmon avx avx2 bmi1 bmi2 bts clflush cmov constant_tsc cpuid cpuid_fault cx16 cx8 de ds_cpl dtes64 dtherm dts epb ept ept_ad erms est f16c flexpriority flush_l1d fma fma3 fpu fsgsbase fxsr ht ibpb ibrs ida invpcid invpcid_single lahf_lm lm mca mce md_clear mmx mmxext monitor movbe msr mtrr nonstop_tsc nopl nx pae pat pbe pcid pclmulqdq pdcm pdpe1gb pebs pge pln pni popcnt pse pse36 pti pts rdrand rdtscp rep_good sdbg sep smep ss ssbd sse sse2 sse3 sse4_1 sse4_2 ssse3 stibp syscall tm tm2 tpr_shadow tsc tsc_adjust tsc_deadline_timer vme vmx vnmi vpid x2apic xsave xsaveopt xtopology xtpr" 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" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-CA en" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="BPF WebAssembly X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby31" VIDEO_CARDS="intel i965" 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" YACC="byacc" Unset: ADDR2LINE, ARFLAGS, AS, ASFLAGS, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, READELF, SIZE, STRINGS, STRIP, YFLAGS
Unfortunately that terminal log isn't telling anything. You'd have to most likely compile firefox with +debug and give a full gdb backtrace to get some idea what's wrong. You may find a working patch from https://git.alpinelinux.org/aports/tree/community/firefox (check the log for latest editions, https://git.alpinelinux.org/aports/log/community/firefox ) but that's a shot in the dark until you know what's causing the issue. Maybe the pipewire is related? Do you visit sites playing some sound, are you using pipewire? Maybe that's busted. Any better with -clang? You can also try -system-icu. But again, just guessing here.
I'm rebuilding with the debug USE flag now to see if I can get any extra information; it'll take a while. Firefox is a bit of a beast though, so I don't really know where to start debugging it to get the stack trace or other handy info. Judging by the nature of the crash (inconsistent segfault) I'm doubtful a stack trace will be super helpful as I kinda expect some random memory is getting corrupted and the crash happens later. Looking at the Alpine patches is a good suggestion, but, this was the first thing I did when I found that 114.0 was crashing and I didn't find anything that was obviously useful. I am using Pipewire but the crash happens in a fresh profile without visiting sites with sound. Additionally, on one of the few occasions Firefox kept running for over a minute (very rare), I was successfully able to play a YouTube video before things crashed. If I were to guess, I would bet this goes away if I use -clang mostly because I think Alpine builds with GCC and most Gentoo folks build with GCC, I have no other solid evidence for this theory though. I'll try -clang and -system-icu after I exhaust what can be figured out with debug. If there's any good advice on how to get good crash data using debug, I'd be happy to hear it :) .
Here's what I was able to get out of lldb and the debug USE flag. I'm happy to get any other useful information; just let me know! $ lldb /usr/lib/firefox/firefox (lldb) target create "/usr/lib/firefox/firefox" Current executable set to '/usr/lib/firefox/firefox' (x86_64). (lldb) r Process 31620 launched: '/usr/lib/firefox/firefox' (x86_64) Process 31620 stopped and restarted: thread 1 received signal: SIGCHLD [31620, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /var/tmp/portage/www-client/firefox-115.0.2/work/firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp:475 Process 31620 stopped and restarted: thread 1 received signal: SIGCHLD [31620, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /var/tmp/portage/www-client/firefox-115.0.2/work/firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp:475 Process 31620 stopped and restarted: thread 14 received signal: SIGCHLD [Parent 31620, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /var/tmp/portage/www-client/firefox-115.0.2/work/firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp:475 [Parent 31620, Main Thread] WARNING: Last startup was detected as a crash.: file /var/tmp/portage/www-client/firefox-115.0.2/work/firefox-115.0.2/toolkit/components/startup/nsAppStartup.cpp:965 [Parent 31620, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /var/tmp/portage/www-client/firefox-115.0.2/work/firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp:475 [Parent 31620, Main Thread] WARNING: NS_ENSURE_SUCCESS(rv, rv) failed with result 0x80004005 (NS_ERROR_FAILURE): file /var/tmp/portage/www-client/firefox-115.0.2/work/firefox-115.0.2/toolkit/xre/nsXREDirProvider.cpp:475 Process 31620 stopped and restarted: thread 2 received signal: SIGCHLD Initializing context 0x7fffd4c01010 surface 0 on display 0x7fffd41f5650 GL_VENDOR: Intel mVendor: Intel GL_RENDERER: Mesa Intel(R) HD Graphics 5000 (HSW GT3) mRenderer: Unknown mIsMesa: 1 [Parent 31620, Renderer] WARNING: robust_buffer_access_behavior marked as unsupported: file /var/tmp/portage/www-client/firefox-115.0.2/work/firefox-115.0.2/gfx/gl/GLContextFeatures.cpp:638 Process 31620 stopped * thread #28, name = 'Renderer', stop reason = signal SIGSEGV: address access protected (fault address: 0x7fffd3c2bf70) frame #0: 0x00007ffff352375b libxul.so`___lldb_unnamed_symbol1528860 + 11 libxul.so`___lldb_unnamed_symbol1528860: -> 0x7ffff352375b <+11>: movq %rdi, -0xc0(%rbp) 0x7ffff3523762 <+18>: movq %rdi, -0x68(%rbp) 0x7ffff3523766 <+22>: cmpq $0x8, %rdi 0x7ffff352376a <+26>: jb 0x7ffff35237bd ; <+109> (lldb) thread backtrace * thread #28, name = 'Renderer', stop reason = signal SIGSEGV: address access protected (fault address: 0x7fffd3c2bf70) * frame #0: 0x00007ffff352375b libxul.so`___lldb_unnamed_symbol1528860 + 11 frame #1: 0x00007ffff3525db6 libxul.so`hashbrown::raw::RawTableInner$LT$A$GT$::fallible_with_capacity::h913e0cc9a8c3f7b9 + 230 frame #2: 0x00007ffff35249c5 libxul.so`hashbrown::raw::RawTableInner$LT$A$GT$::prepare_resize::hf767a6f73cfed69f + 149 frame #3: 0x00007ffff3523c0c libxul.so`hashbrown::raw::RawTable$LT$T$C$A$GT$::reserve_rehash::h5d23dcd0477db7da + 716 frame #4: 0x00007ffff3524560 libxul.so`hashbrown::raw::RawTable$LT$T$C$A$GT$::reserve::ha2fa9ee2188b62e0 + 80 frame #5: 0x00007ffff352439e libxul.so`hashbrown::raw::RawTable$LT$T$C$A$GT$::insert::h15e68bcb0d047620 + 286 frame #6: 0x00007ffff3523179 libxul.so`hashbrown::map::HashMap$LT$K$C$V$C$S$C$A$GT$::insert::hd5b2c12170362d37 + 409 frame #7: 0x00007ffff350d251 libxul.so`std::collections::hash::map::HashMap$LT$K$C$V$C$S$GT$::insert::hafa9b3bf3a202ad9 + 33 frame #8: 0x00007ffff3526db3 libxul.so`webrender_build::shader_features::get_shader_features::hc601af9ed62b43ed + 227 frame #9: 0x00007ffff3398d3f libxul.so`webrender::renderer::shade::Shaders::new::h4c6e9c42c4477015 + 367 frame #10: 0x00007ffff2d48bf2 libxul.so`___lldb_unnamed_symbol1524362 + 1106 frame #11: 0x00007fffe89a786e libxul.so`___lldb_unnamed_symbol555812 + 126 frame #12: 0x00007fffe89a7330 libxul.so`___lldb_unnamed_symbol555802 + 80 frame #13: 0x00007fffe898c653 libxul.so`___lldb_unnamed_symbol555190 + 291 frame #14: 0x00007fffe899287a libxul.so`___lldb_unnamed_symbol555331 + 106 frame #15: 0x00007fffe899ca88 libxul.so`___lldb_unnamed_symbol555582 + 488 frame #16: 0x00007fffe89c527e libxul.so`___lldb_unnamed_symbol557533 + 110 frame #17: 0x00007fffe89c51fd libxul.so`___lldb_unnamed_symbol557532 + 29 frame #18: 0x00007fffe89c51ad libxul.so`___lldb_unnamed_symbol557530 + 29 frame #19: 0x00007fffe89c517d libxul.so`___lldb_unnamed_symbol557529 + 45 frame #20: 0x00007fffe89c4fed libxul.so`___lldb_unnamed_symbol557525 + 29 frame #21: 0x00007fffe89c4fa9 libxul.so`___lldb_unnamed_symbol557524 + 121 frame #22: 0x00007fffe794d50e libxul.so`___lldb_unnamed_symbol416358 + 126 frame #23: 0x00007fffe6b73679 libxul.so`___lldb_unnamed_symbol302514 + 2185 frame #24: 0x00007fffe6b7b856 libxul.so`___lldb_unnamed_symbol302703 + 150 frame #25: 0x00007fffe7a5be21 libxul.so`___lldb_unnamed_symbol426398 + 945 frame #26: 0x00007fffe7975538 libxul.so`___lldb_unnamed_symbol417996 + 120 frame #27: 0x00007fffe79754b5 libxul.so`___lldb_unnamed_symbol417995 + 21 frame #28: 0x00007fffe7975472 libxul.so`___lldb_unnamed_symbol417994 + 82 frame #29: 0x00007fffe6b6ddf0 libxul.so`___lldb_unnamed_symbol302392 + 928 frame #30: 0x00007ffff7d6dcc2 libnspr4.so`___lldb_unnamed_symbol1035 + 290
These upstream bugs look related. I'll try to include the patches into 116 which is out next week. You can test them via /etc/portage/patches already of course.
I rebuilt 115.0.2 with the patch you linked and everything is stable again. Thanks for looking in to this and getting this in to the next version!
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1fd128403bb5b3b4619b07e4964f7dfff635f41c commit 1fd128403bb5b3b4619b07e4964f7dfff635f41c Author: Joonas Niilola <juippis@gentoo.org> AuthorDate: 2023-08-01 10:03:51 +0000 Commit: Joonas Niilola <juippis@gentoo.org> CommitDate: 2023-08-01 10:04:27 +0000 www-client/firefox: add 116.0 Closes: https://bugs.gentoo.org/910689 Bug: https://bugs.gentoo.org/910290 Closes: https://bugs.gentoo.org/888055 Bug: https://bugs.gentoo.org/909724 Closes: https://bugs.gentoo.org/904354 Signed-off-by: Joonas Niilola <juippis@gentoo.org> www-client/firefox/Manifest | 101 +++ www-client/firefox/firefox-116.0.ebuild | 1466 +++++++++++++++++++++++++++++++ 2 files changed, 1567 insertions(+)