Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 874984 - www-client/firefox-102.3.0: Segfault at startup
Summary: www-client/firefox-102.3.0: Segfault at startup
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal critical (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-04 16:29 UTC by Stefan Ott
Modified: 2022-10-19 19:01 UTC (History)
2 users (show)

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


Attachments
Trace (firefox-trace.txt,691.83 KB, text/plain)
2022-10-04 16:30 UTC, Stefan Ott
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Ott 2022-10-04 16:29:44 UTC
Since the latest upgrade Firefox segfaults at startup. I can open the profile selector (firefox -P) but starting it normally (or selecting a profile), I get a segfault.

This also affects newly created profiles, not just existing ones.

Reproducible: Always

Steps to Reproduce:
1. Start firefox
Actual Results:  
Segmentation fault


This is on AMD64 with Wayland (sway), Kernel 5.15.69
Comment 1 Stefan Ott 2022-10-04 16:30:55 UTC
Created attachment 819232 [details]
Trace
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-10-04 16:45:59 UTC
Can you get a backtrace with gdb?
Comment 3 Stefan Ott 2022-10-04 16:53:34 UTC
Interestingly, I can't.

It seems that if I start it directly as /usr/lib64/firefox/firefox, it works. It only segfaults when starting through the /usr/bin/firefox wrapper.

This gives me something to poke around, I'll report back.
Comment 4 Stefan Ott 2022-10-04 17:00:33 UTC
Okay, it only crashes if MOZ_ENABLE_WAYLAND=1

This is what gdb says:

Thread 1 "firefox" received signal SIGSEGV, Segmentation fault.
0x00007ffff6465921 in XInternAtoms () from /usr/lib64/libX11.so.6
#0  0x00007ffff6465921 in XInternAtoms () at /usr/lib64/libX11.so.6
#1  0x00007ffff30633fd in  () at /usr/lib64/firefox/libxul.so
#2  0x00007ffff30610ba in  () at /usr/lib64/firefox/libxul.so
#3  0x00007ffff30616c1 in  () at /usr/lib64/firefox/libxul.so
#4  0x00007ffff321da9f in  () at /usr/lib64/firefox/libxul.so
#5  0x00007ffff321e5ce in  () at /usr/lib64/firefox/libxul.so
#6  0x00007ffff321e95a in  () at /usr/lib64/firefox/libxul.so
#7  0x000055555557c103 in  ()
#8  0x00007ffff7bb634c in __libc_start_call_main () at /lib64/libc.so.6
#9  0x00007ffff7bb63fc in __libc_start_main () at /lib64/libc.so.6
#10 0x000055555557bbe1 in _start ()
Comment 5 Joonas Niilola gentoo-dev 2022-10-04 17:07:40 UTC
I wonder, have you ran firefox-esr through xwayland previously? Nothing should change between 102.2.0 -> 102.3.0 really. Have you made changes to the ebuild or applied custom patches?

Oh, maybe this is related after all?
https://gitweb.gentoo.org/repo/gentoo.git/commit/www-client/firefox?id=78eb14ad88d022bff0d59ba4579e3ca29f0708d2
although I'm not 100 % sure how it would relate to the wrapper script. But ... wayland things?
Comment 6 Stefan Ott 2022-10-04 17:17:52 UTC
I just checked my portage summary.log - it seems I upgraded directly from version 91.13.0. Maybe the change happened somewhere in between?

Also, I have apparently had version 102.3.0 installed for about 2 weeks now, but I really have no idea whether I ever started the web browser during that time.
Comment 7 Joonas Niilola gentoo-dev 2022-10-04 17:24:40 UTC
There might be... 

91.13.0 had:
--enable-default-toolkit=cairo-gtk3-wayland

while 102.3.0 is:
--enable-default-toolkit=cairo-gtk3-x11-wayland

when wayland is enabled.

Now both of these configure options *should* work exactly the same, but... maybe they don't? Could you try and replace "cairo-gtk3-x11-wayland" with "cairo-gtk3-wayland" in your 102.3.0 ebuild? This should work too: 
EXTRA_ECONF="--enable-default-toolkit=cairo-gtk3-wayland" emerge -av firefox

but make sure it does get enabled. If you edit your ebuild, remember to git restore it back before next emerge --sync, or edit it in your own overlay (make sure the overlay ebuild is emerged)
Comment 8 Stefan Ott 2022-10-04 17:25:44 UTC
Thanks, I'll try.
Comment 9 Stefan Ott 2022-10-04 18:07:08 UTC
Unfortunately that didn't help, I'm still getting segfaults.
Comment 10 Emily Rowlands 2022-10-04 18:31:20 UTC
This feels similar to bug 866151. Could it be the same root cause surfacing in a different way?
Comment 11 Joonas Niilola gentoo-dev 2022-10-04 18:47:58 UTC
Stefan, could you show:
emerge --nodeps -pv firefox:esr gtk+:3
emerge --info

Also I guess the whole build.log could be helpful here to spot things related to Emily's suggestion.

Firefox enabled wayland-only build "in theory" in version 101, so jumping from 91 to 102 there has indeed been a lot of wayland updates. You may also find more luck trying out the rapid version, which allows to build firefox without X support altogether.
Comment 12 Stefan Ott 2022-10-04 20:23:15 UTC
I'll do some more experiments later and report back (unfortunately it takes a while to compile...) and also post a complete build log.

As for the things you asked for:

# emerge --nodeps -pv firefox:esr gtk+:3

These are the packages that would be merged, in order:

[ebuild   R    ] www-client/firefox-102.3.0:esr::ott  USE="clang eme-free hardened openh264 system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-png system-webp wayland -dbus -debug -geckodriver (-gmp-autoupdate) -hwaccel -jack -libproxy -lto -pgo -pulseaudio -screencast (-selinux) -sndio (-system-python-libs) -wifi" L10N="-ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -ca-valencia -cak -cs -cy -da -de -dsb -el -en-CA -en-GB -eo -es-AR -es-CL -es-ES -es-MX -et -eu -fa -ff -fi -fr -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 -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
[ebuild   R    ] x11-libs/gtk+-3.24.34:3::gentoo  USE="X cups wayland (-aqua) -broadway -colord -examples -gtk-doc -introspection -sysprof -test -vim-syntax -xinerama" 21,082 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 21,082 KiB

# emerge --info
Portage 3.0.38.1 (python 3.10.6-final-0, default/linux/amd64/17.1/no-multilib/hardened, gcc-11.3.0, glibc-2.35-r8, 5.15.69-gentoo x86_64)
=================================================================
System uname: Linux-5.15.69-gentoo-x86_64-11th_Gen_Intel-R-_Core-TM-_i5-1135G7_@_2.40GHz-with-glibc2.35
KiB Mem:    32572076 total,  29153380 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 04 Oct 2022 16:00:01 +0000
Head commit of repository gentoo: 4f2cd9cb581c3643136c97bfd1c6dd1a5702839e
Timestamp of repository guru: Tue, 04 Oct 2022 12:32:47 +0000
Head commit of repository guru: 661bf3cf0a99ee52d2a632ba7294b2d451e0bb7a

Head commit of repository ott: 70a487a690575433863fbdf09de4498754f5d01b

sh bash 5.1_p16-r1
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           3.10.6_p4::gentoo
dev-lang/rust:             1.62.1::gentoo
dev-util/cmake:            3.23.3::gentoo
dev-util/meson:            0.62.2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.45.2::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
sys-devel/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/lld:             14.0.6::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r8::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-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

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

local
    location: /var/db/repos/local
    masters: gentoo

ott
    location: /var/db/repos/ott
    sync-type: git
    sync-uri: ssh://git@git.ott.net:31022/portage-overlay
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE no-source-code linux-fw-redistributable intel-ucode DisplayLink-EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=tigerlake -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=tigerlake -O2 -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="-march=tigerlake -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=tigerlake -O2 -pipe"
GENTOO_MIRRORS="rsync://mirror.init7.net/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
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"
SHELL="/bin/bash"
USE="X acl alsa amd64 bzip2 cli crypt cups dri elogind fortran gdbm hardened iconv ipv6 jpeg libglvnd libtirpc ncurses nls nptl openmp pam pcre pie readline seccomp split-usr ssl ssp unicode wayland xattr xtpax zlib" ABI_X86="64" ADA_TARGET="gnat_2020" 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="aes avx avx2 avx512f avx512dq avx512cd avx512bw avx512vl avx512vbmi f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" 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="evdev synaptics" 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="intel iris fbdev" 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:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 13 Joonas Niilola gentoo-dev 2022-10-05 05:38:21 UTC
This might be #822237 - in other words, you might need +dbus with +wayland ALWAYS. This requirement has been patched away in our :rapid build but now I imagine I didn't backport the patch to :esr, and just forgot to reflect that in the ebuild.
Comment 14 Stefan Ott 2022-10-06 02:32:14 UTC
(In reply to Joonas Niilola from comment #13)
> This might be #822237 - in other words, you might need +dbus with +wayland
> ALWAYS. This requirement has been patched away in our :rapid build but now I
> imagine I didn't backport the patch to :esr, and just forgot to reflect that
> in the ebuild.

That could very well be the case. I tried upgrading to version 105.0.2 and that fixed the problem for me.
Comment 15 Larry the Git Cow gentoo-dev 2022-10-06 11:13:42 UTC
The bug has been closed via the following commit(s):

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

commit 167e6a25d28f7f7737eb9b24926e96bb76053ceb
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2022-10-06 11:12:21 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-10-06 11:12:21 +0000

    www-client/firefox: add "REQUIRED_USE wayland? ( dbus )" back to esr
    
     - this requirement has been patched out from :rapid version, but
       still necessary in the esr one.
    
    Closes: https://bugs.gentoo.org/874984
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/firefox-102.3.0.ebuild | 1 +
 1 file changed, 1 insertion(+)
Comment 16 Jaak Ristioja 2022-10-19 19:01:20 UTC
Btw, a workaround to circumvent this crash might be to start firefox with the --no-remote flag.