Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 693830 - www-client/firefox-69.0 USE=pgo : src_compile(): Firefox exited with code 132 during profile initialization (avx2 in constructors)
Summary: www-client/firefox-69.0 USE=pgo : src_compile(): Firefox exited with code 132...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-09-08 20:17 UTC by J.Borme
Modified: 2020-10-10 16:57 UTC (History)
4 users (show)

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


Attachments
build log (build.log.xz,391.27 KB, application/x-xz)
2019-09-08 20:17 UTC, J.Borme
Details
build.log (build.log.xz,475.68 KB, application/x-xz)
2019-09-19 19:19 UTC, Johannes Hirte
Details
native.opts (native.opts,9.84 KB, text/plain)
2019-09-19 19:19 UTC, Johannes Hirte
Details

Note You need to log in before you can comment on or make changes to this bug.
Description J.Borme 2019-09-08 20:17:55 UTC
Created attachment 589482 [details]
build log

Build failure:
79:54.38 JARLOG_FILE=jarlog/en-US.log /var/tmp/portage/portage/www-client/firefox-69.0/work/firefox-69.0/ff/_virtualenvs/init/bin/python /var/tmp/portage/portage/www-client/firefox-69.0/work/firefox-69.0/build/pgo/profileserver.py
879:54.38 Firefox exited with code 132 during profile initialization
879:54.38 gmake[1]: *** [Makefile:195: profiledbuild] Error 132

[ebuild     U ] www-client/firefox-69.0 [68.0.2] USE="bindist eme-free hardened lto pgo screenshot startup-notification system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-sqlite system-webp -clang -custom-cflags -custom-optimization -debug -geckodriver -gmp-autoupdate -hwaccel -jack (-neon) -pulseaudio (-selinux) -system-libvpx -test -wayland -wifi (-dbus%*)" CPU_FLAGS_X86="-avx2" L10N="fr -ach -af -an -ar -ast -az -be -bg -bn -br -bs -ca -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 -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 -nl -nn -oc -pa -pl -pt-BR -pt-PT -rm -ro -ru -si -sk -sl -son -sq -sr -sv -ta -te -th -tr -uk -ur -uz -vi -xh -zh-CN -zh-TW"

Found an upstream bug that has similar keywords, but was already corrected.
https://bugzilla.mozilla.org/show_bug.cgi?id=1548515
Comment 1 J.Borme 2019-09-08 20:19:14 UTC
Portage 2.3.69 (python 3.6.5-final-0, default/linux/amd64/17.1/desktop, gcc-9.2.0, glibc-2.29-r2, 5.2.13-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.2.13-gentoo-x86_64-Intel-R-_Core-TM-_i7-2600K_CPU_@_3.40GHz-with-gentoo-2.6
KiB Mem:    14315716 total,   6809876 free
KiB Swap:   17407996 total,  15684852 free
Timestamp of repository gentoo: Sun, 08 Sep 2019 14:15:01 +0000
Head commit of repository gentoo: 827a603959ff6bc219b6c5908bc8030b8093b412
sh bash 4.4_p23-r1
ld GNU ld (Gentoo 2.32 p2) 2.32.0
app-shells/bash:          4.4_p23-r1::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.28.2-r1::gentoo
dev-lang/python:          2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:           3.14.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.6-r1::gentoo
sys-apps/openrc:          0.41.2::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.16.1-r1::gentoo
sys-devel/binutils:       2.32-r1::gentoo
sys-devel/gcc:            8.3.0-r1::gentoo, 9.2.0::gentoo
sys-devel/gcc-config:     2.0::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1-r4::gentoo
sys-kernel/linux-headers: 5.2::gentoo (virtual/os-headers)
sys-libs/glibc:           2.29-r2::gentoo
Repositories:

personnel
    location: /usr/overlays/personnel
    masters: gentoo
    priority: 0

chaoslab
    location: /var/lib/layman/chaoslab
    sync-type: laymansync
    sync-uri: https://gitlab.com/chaoslab/chaoslab-overlay.git
    masters: gentoo
    priority: 50

palemoon
    location: /var/lib/layman/palemoon
    sync-type: laymansync
    sync-uri: https://github.com/deu/palemoon-overlay.git
    masters: gentoo
    priority: 50

science
    location: /var/lib/layman/science
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/sci.git
    masters: gentoo
    priority: 50

stuff
    location: /var/lib/layman/stuff
    sync-type: laymansync
    sync-uri: https://github.com/istitov/stuff.git
    masters: gentoo
    priority: 50

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync2.pt.gentoo.org/gentoo-portage
    priority: 9999
    sync-rsync-verify-metamanifest: true
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -mtune=native"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -mtune=native"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps=y --keep-going"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs 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 sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://ftp.rnl.tecnico.ulisboa.pt/pub/gentoo/gentoo-distfiles/ ftp://gentoo.mirrors.ovh.net/gentoo-distfiles/ ftp://ftp.halifax.rwth-aachen.de/gentoo/ ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo http://www.ibiblio.org/pub/Linux/distribution/gentoo http://distfiles.gentoo.org"
LANG="fr_FR.UTF-8"
LDFLAGS="-Wl,-O1"
LINGUAS="fr pt de pt_PT fr_FR"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--itemize-changes --recursive --links --safe-links --perms --times --omit-dir-times --omit-link-times --compress --force --whole-file --delete --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"
PORTAGE_TMPDIR="/var/tmp/portage"
USE="X a52 aac acl acpi alsa amd64 bash-completion berkdb bluetooth branding bzip2 c++0x cairo cdda cdr cli consolekit crypt cups cxx dbus dri dts dvd dvdr emboss encode exif fam flac fortran gdbm gif glamor gpm gtk hal iconv icu idn ipv6 jpeg julia kde lcms ldap libaom libnotify libtirpc lzma mad mng mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp opus pam pango pch pcre pdf pie png ppds qt5 readline sdl seccomp spell split-usr ssl startup-notification svg tcpd threads tiff truetype udev unicode upower usb vim-syntax vorbis wxwidgets x264 xattr xcb xetex xml xv xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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="braindump flow karbon krita sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev keyboard mouse" KERNEL="linux" L10N="fr fr-FR" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-2" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="radeon intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2019-09-09 06:52:15 UTC
I can confirm this bug. I experience this bug on a similar CPU. Because I don't run into this bug on newer CPUs I currently assume it's CPU-feature related (like bug 677052 in the past).

I still need to test if it works with USE=clang on these systems.
Comment 3 J.Borme 2019-09-09 15:22:51 UTC
It emerges with USE="clang pgo"
I used clang-8.0.1 (and lld-8.0.1) for the test.
Comment 4 Johannes Hirte 2019-09-17 04:59:52 UTC
same here on AMD A6-3650 APU and sys-devel/gcc-9.2.0

calling /var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/ff/_virtualenvs/init/bin/python /var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/build/pgo/profileserver.py by hand results in

traps: firefox[650415] trap invalid opcode ip:7fb4f39cf7a7 sp:7ffe0e7bd840 error:0 in libxul.so[7fb4f3867000+a48a000]
Comment 5 Johannes Hirte 2019-09-17 18:21:05 UTC
same with:

sys-devel/gcc-8.3.0-r1
sys-devel/gcc-9.1.0-r1
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2019-09-18 18:49:15 UTC
Whissi posted some details on #gentoo-toolchain around the failure.

The backtrace says crash happens at library init time:

"""
Core was generated by `/var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/ff/dist/firefox/fire'.
Program terminated with signal SIGILL, Illegal instruction.
#0  0x00007fe43a3d2b1d in global constructors keyed to 65535_1_buildid.i_o.6029253 ()
   from /var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/ff/dist/firefox/libxul.so
(gdb)
(gdb)
(gdb) bt
#0  0x00007fe43a3d2b1d in global constructors keyed to 65535_1_buildid.i_o.6029253 ()
    at /var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/ff/dist/firefox/libxul.so
#1  0x00007fe44c3742fa in call_init
    (l=<optimized out>, argc=argc@entry=4, argv=argv@entry=0x7ffeb5f21158, env=env@entry=0x7fe44bb1e000)
    at dl-init.c:72
...
#11 0x00007fe44c319346 in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
#12 0x000055a488d8d5bc in XPCOMGlueLoad(char const*, mozilla::LibLoadingStrategy) ()
#13 0x000055a488d8d9f8 in mozilla::GetBootstrap(char const*, mozilla::LibLoadingStrategy) ()
#14 0x000055a488d8e1b7 in InitXPCOMGlue(mozilla::LibLoadingStrategy) ()
#15 0x000055a488d8e44a in main ()
"""

The disassembly of 65535_1_buildid.i_o.6029253 says it is a quite long init list:

"""
(gdb) disassemble
Dump of assembler code for function _GLOBAL__I_65535_1_buildid.i_o.6029253:
   0x00007fe43a3d0e80 <+0>:     push   %rbp
   0x00007fe43a3d0e81 <+1>:     mov    %rsp,%rbp
...
=> 0x00007fe43a3d2b1d <+7325>:  vextracti128 $0x1,%ymm0,0xa8c1dd1(%rip)        # 0x7fe444c948f8 <_ZN6SkOpts11stages_lowpE+312>
...
"""

(_ZN6SkOpts11stages_lowpE is SkOpts::stages_lowp).

This means gcc compiled global constructors with -mavx2 equivalent, a variation of bug #677052 mentioned above.

The trigger is probably a
    skia/third_party/skcms/skcms.cc:        #pragma GCC target("avx2,f16c")
applied to too broad subset of code and is an effect of -flto.

Extracting smaller reproducer would be nice. But perhaps not very easy.
Comment 7 Johannes Hirte 2019-09-18 19:34:31 UTC
I was able to build ff-69 with sys-devel/gcc-7.4.0-r2. 

Disassembled libxul.so doesn't contain any vextracti128, but several vextractf128 instead. Interestingly even the successful build version, compiled with gcc-7.4 has 6 occurrence of vextractf128, whereas libxul.so from incomplete build contains 22 of vextractf128.
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2019-09-18 21:20:17 UTC
(In reply to Johannes Hirte from comment #7)
> I was able to build ff-69 with sys-devel/gcc-7.4.0-r2. 
> 
> Disassembled libxul.so doesn't contain any vextracti128, but several
> vextractf128 instead. Interestingly even the successful build version,
> compiled with gcc-7.4 has 6 occurrence of vextractf128, whereas libxul.so
> from incomplete build contains 22 of vextractf128.

firefox does contain explicit avx2-optimised code for all target, that is fine. Thus it is expected to see avx2 instructions in both cases.

The problem is where exactly it contains such code. In this bug avx2 code leaks out of 'if (supports(avx2)) { ... }' (pseudo) condition.
Comment 9 Johannes Hirte 2019-09-19 12:51:30 UTC
on my llano it looks really different:

Thread 1 "firefox" received signal SIGILL, Illegal instruction.
0x00007fffe5e20887 in global constructors keyed to 65535_1_buildid.i_o.6033832 () from /var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/ff/dist/bin/libxul.so
(gdb) bt
#0  0x00007fffe5e20887 in global constructors keyed to 65535_1_buildid.i_o.6033832 () at /var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/ff/dist/bin/libxul.so
#1  0x00007ffff7fe3552 in  () at /lib64/ld-linux-x86-64.so.2
#2  0x00007ffff7fe3661 in  () at /lib64/ld-linux-x86-64.so.2
#3  0x00007ffff7fe75e3 in  () at /lib64/ld-linux-x86-64.so.2
#4  0x00007ffff7c2fd11 in _dl_catch_exception () at /lib64/libc.so.6
#5  0x00007ffff7fe6e9a in  () at /lib64/ld-linux-x86-64.so.2
#6  0x00007ffff7f542cc in  () at /lib64/libdl.so.2
#7  0x00007ffff7c2fd11 in _dl_catch_exception () at /lib64/libc.so.6
#8  0x00007ffff7c2fdaf in _dl_catch_error () at /lib64/libc.so.6
#9  0x00007ffff7f54b9d in  () at /lib64/libdl.so.2
#10 0x00007ffff7f54366 in dlopen () at /lib64/libdl.so.2
#11 0x00005555556262a8 in XPCOMGlueLoad(char const*, mozilla::LibLoadingStrategy) ()
#12 0x00005555556266b1 in mozilla::GetBootstrap(char const*, mozilla::LibLoadingStrategy) ()
#13 0x0000555555626e74 in InitXPCOMGlue(mozilla::LibLoadingStrategy) ()
#14 0x0000555555627105 in main ()

disassembly says:

=> 0x00007fffe5e20887 <+3239>:  vmovsd 0x8eed8d9(%rip),%xmm0        # 0x7fffeed0e168


So it's not AVX2 code, but an AVX instruction.
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2019-09-19 18:47:21 UTC
(In reply to Johannes Hirte from comment #9)
> on my llano it looks really different:
> 
> Thread 1 "firefox" received signal SIGILL, Illegal instruction.
> 0x00007fffe5e20887 in global constructors keyed to
> 65535_1_buildid.i_o.6033832 () from
> /var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/ff/dist/bin/
> libxul.so
> (gdb) bt
> #0  0x00007fffe5e20887 in global constructors keyed to
> 65535_1_buildid.i_o.6033832 () at
> /var/tmp/portage/www-client/firefox-69.0/work/firefox-69.0/ff/dist/bin/
> libxul.so
> #1  0x00007ffff7fe3552 in  () at /lib64/ld-linux-x86-64.so.2
> #2  0x00007ffff7fe3661 in  () at /lib64/ld-linux-x86-64.so.2
> #3  0x00007ffff7fe75e3 in  () at /lib64/ld-linux-x86-64.so.2
> #4  0x00007ffff7c2fd11 in _dl_catch_exception () at /lib64/libc.so.6
> #5  0x00007ffff7fe6e9a in  () at /lib64/ld-linux-x86-64.so.2
> #6  0x00007ffff7f542cc in  () at /lib64/libdl.so.2
> #7  0x00007ffff7c2fd11 in _dl_catch_exception () at /lib64/libc.so.6
> #8  0x00007ffff7c2fdaf in _dl_catch_error () at /lib64/libc.so.6
> #9  0x00007ffff7f54b9d in  () at /lib64/libdl.so.2
> #10 0x00007ffff7f54366 in dlopen () at /lib64/libdl.so.2
> #11 0x00005555556262a8 in XPCOMGlueLoad(char const*,
> mozilla::LibLoadingStrategy) ()
> #12 0x00005555556266b1 in mozilla::GetBootstrap(char const*,
> mozilla::LibLoadingStrategy) ()
> #13 0x0000555555626e74 in InitXPCOMGlue(mozilla::LibLoadingStrategy) ()
> #14 0x0000555555627105 in main ()
> 
> disassembly says:
> 
> => 0x00007fffe5e20887 <+3239>:  vmovsd 0x8eed8d9(%rip),%xmm0        #
> 0x7fffeed0e168
> 
> 
> So it's not AVX2 code, but an AVX instruction.

That's interesting. Especially that your CFLAGS don't force anything outside generic x86_64. What does gcc expand -mtune=native to for you?

    https://wiki.gentoo.org/wiki/Gcc-ICE-reporting-guide#Expand_-march.3Dnative.2C_exact_gcc_version_and_other_system-specific_options

Looking at your build.log -mavx2 is used for vp9, and -mavx is used for skia.

At least skia has global constructors.
Comment 11 Johannes Hirte 2019-09-19 19:18:32 UTC
Not my build.log, uploading it now.

Btw. www-client/firefox-69.0.1 has build without errors now.
Comment 12 Johannes Hirte 2019-09-19 19:19:06 UTC
Created attachment 590384 [details]
build.log
Comment 13 Johannes Hirte 2019-09-19 19:19:24 UTC
Created attachment 590386 [details]
native.opts
Comment 14 Sergei Trofimovich (RETIRED) gentoo-dev 2019-09-19 20:49:44 UTC
How to track down the instruction origin.

If you build firefox with at least a bit of debugging info you should see symbol name in gdb attached to faulty instruction:

=> 0x00007fe43a3d2b1d <+7325>:  vextracti128 $0x1,%ymm0,0xa8c1dd1(%rip)        # 0x7fe444c948f8 <_ZN6SkOpts11stages_lowpE+312>

$ c++filt _ZN6SkOpts11stages_lowpE
SkOpts::stages_lowp

Note: it's a store into SkOpts::stages_lowp[].

I guess it comes from

gfx/skia/skia/src/opts/SkOpts_avx.cpp:

namespace SkOpts {
    void Init_avx() {
        memset16 = SK_OPTS_NS::memset16;
        memset32 = SK_OPTS_NS::memset32;
        memset64 = SK_OPTS_NS::memset64;

#ifdef __clang__
    #define M(st) stages_highp[SkRasterPipeline::st] = (StageFn)SK_OPTS_NS::st;
        SK_RASTER_PIPELINE_STAGES(M)
        just_return_highp = (StageFn)SK_OPTS_NS::just_return;
        start_pipeline_highp = SK_OPTS_NS::start_pipeline;
    #undef M

    #define M(st) stages_lowp[SkRasterPipeline::st] = (StageFn)SK_OPTS_NS::lowp::st;
        SK_RASTER_PIPELINE_STAGES(M)
        just_return_lowp = (StageFn)SK_OPTS_NS::lowp::just_return;
        start_pipeline_lowp = SK_OPTS_NS::lowp::start_pipeline;
    #undef M
#endif
    }
}

and is used in

gfx/skia/skia/src/core/SkOpts.cpp

    static void init() {
#if !defined(SK_BUILD_NO_OPTS)
    #if defined(SK_CPU_X86)
        #if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_SSSE3
            if (SkCpu::Supports(SkCpu::SSSE3)) { Init_ssse3(); }
        #endif

        #if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_SSE41
            if (SkCpu::Supports(SkCpu::SSE41)) { Init_sse41(); }
        #endif

        #if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_SSE42
            if (SkCpu::Supports(SkCpu::SSE42)) { Init_sse42(); }
        #endif

        #if SK_CPU_SSE_LEVEL < SK_CPU_SSE_LEVEL_AVX
            if (SkCpu::Supports(SkCpu::AVX)) { Init_avx();   }
            if (SkCpu::Supports(SkCpu::HSW)) { Init_hsw();   }
        #endif

        if (SkCpu::Supports(SkCpu::HSW  )) { Init_hsw();   }

    #elif defined(SK_CPU_ARM64)
        if (SkCpu::Supports(SkCpu::CRC32)) { Init_crc32(); }

    #endif
#endif
    }

    void Init() {
        static SkOnce once;
        once(init);
    }

Looking at build commands from your build log:

  /usr/bin/x86_64-pc-linux-gnu-g++ -o SkOpts_avx.i_o -c ... -O3 -mavx  ...
  /usr/bin/x86_64-pc-linux-gnu-g++ -o SkOpts.i_o -c ...  -O3 ...

Now the question is: why this code gets executed for you.

H1: 'if (SkCpu::Supports(SkCpu::AVX)) { Init_avx();   }' misfires on your CPU. You might want to add printf() into if statement and see if it gets called.
H2: lto hoists array store above conditional statement (not very likely)
H3: lto applies -mavx to all of global initializers
Comment 15 Sergei Trofimovich (RETIRED) gentoo-dev 2019-09-19 21:24:06 UTC
69.0 vs. 69.0.1 ebuilds materially differ (I assume) in how they handle lto:

$ diff -U1 firefox-69.0.ebuild firefox-69.0.1.ebuild
--- firefox-69.0.ebuild	2019-09-08 02:00:31.000000000 +0100
+++ firefox-69.0.1.ebuild	2019-09-18 23:12:18.000000000 +0100
@@ -259,2 +259,3 @@
 	eapply "${WORKDIR}/firefox"
+	eapply "${FILESDIR}/${PN}-69.0-lto-gcc-fix.patch"

@@ -386,5 +387,2 @@

-			# Bug 689358
-			append-cxxflags -flto
-
 			if ! use cpu_flags_x86_avx2 ; then

You might need to compare build logs to find which build command lost/changed -flto.
Comment 16 Thomas Deutschmann (RETIRED) gentoo-dev 2019-09-19 22:41:03 UTC
JFYI: The changes between 69.0 and 69.0.1 in ebuild are for bug 689358 and have nothing to do with this bug report.
Comment 17 Sergei Trofimovich (RETIRED) gentoo-dev 2019-09-19 23:23:43 UTC
(In reply to Thomas Deutschmann from comment #16)
> JFYI: The changes between 69.0 and 69.0.1 in ebuild are for bug 689358 and
> have nothing to do with this bug report.

You mean they were not intended to fix this bug. But they are certainly upsetting the setup.
Comment 18 Johannes Hirte 2019-09-20 07:16:02 UTC
(In reply to Thomas Deutschmann from comment #16)
> JFYI: The changes between 69.0 and 69.0.1 in ebuild are for bug 689358 and
> have nothing to do with this bug report.

They have! Removing the patch and adding the "append-cxxflags -flto" leads to the bug. At moment I test with patch and "append-cxxflags -flto" for isolating the root issue.
Comment 19 Thomas Deutschmann (RETIRED) gentoo-dev 2019-09-20 07:19:27 UTC
I can confirm that the error is gone on my system with =firefox-69.0.1. So yeah, looks like append-* did trigger this but just for some CPUs....
Comment 20 Johannes Hirte 2019-09-20 08:26:19 UTC
(In reply to Thomas Deutschmann from comment #19)
> I can confirm that the error is gone on my system with =firefox-69.0.1. So
> yeah, looks like append-* did trigger this but just for some CPUs....

So it's clear that build with clang and gcc < 8 is not affected, as -flto is not appended in this case.
Comment 21 Johannes Hirte 2019-09-20 10:11:43 UTC
Yes, "append-cxxflags -flto" leaks the avx(2)-code into areas, where it doesn't belong. Tested with "${FILESDIR}/${PN}-69.0-lto-gcc-fix.patch".
Comment 22 Sergei Trofimovich (RETIRED) gentoo-dev 2019-09-20 18:49:24 UTC
One of workarounds would be to prevent inlining of all init functions in skia in firefox with something like __attribute__((noinline)). I'm also not sure if CPU feature selector in skia is entirely bugless. 

Would be nice to extract smaller example based on skia only if possible.
Comment 23 Johannes Hirte 2019-09-22 18:59:13 UTC
With clang-8.0.1 I could not trigger this bug when adding "append-cxxflags -flto". So this is definitively a gcc bug, at least since gcc-8.
Comment 24 Jory A. Pratt gentoo-dev 2020-03-29 20:46:53 UTC
Who can confirm this is still an issue with that last ~testing version in the tree, I believe it is 74.0.x
Comment 25 Michał Dec 2020-08-28 09:51:29 UTC
I'm trying to emerge firefox-68.12.0 and I get error 132 during profile initialization as well. Here are my USEflags for this package:
+bindist
+custom-cflags
+custom-optimization
+dbus
+geckodriver
+gmp-autoupdate
+hwaccel
+l10n_pl
+l10n_zh-CN
+lto
+openh264
+pgo
+pulseaudio
+screenshot
+system-av1
+system-harfbuzz
+system-icu
+system-jpeg
+system-libevent
+system-libvpx
+system-sqlite
+system-webp
+wayland

I'm using clang-10.0.0 and gcc-9.3.0-r1. My CFLAGS are "-O2 -pipe -march=nehalem -mtune=nehalem -ggdb", so the most advanced SIMDs it should trigger is SSE4.something and popcount.
Comment 26 Thomas Deutschmann (RETIRED) gentoo-dev 2020-10-10 16:57:20 UTC
Please re-open if you are still seeing this error in >=www-client/firefox-78.3.1.