Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 873823 - www-client/firefox-102.3.0: crashes on startup on ppc64: Unknown image format 0
Summary: www-client/firefox-102.3.0: crashes on startup on ppc64: Unknown image format 0
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC64 Linux
: Normal normal (vote)
Assignee: Mozilla Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-01 10:41 UTC by Marcus Comstedt
Modified: 2023-07-19 06:15 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Comstedt 2022-10-01 10:41:49 UTC
When trying to start firefox, I get the following messages:

---8<---
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
ATTENTION: default value of option mesa_glthread overridden by environment.
Crash Annotation GraphicsCriticalError: |[0][GFX1]: Unknown image format 0 (t=1.61474) [GFX1]: Unknown image format 0
Exiting due to channel error.
Segmentation fault
---8<---

I expect the segfault is intentional and triggered by the handler for critical errors.

Anyway, image format 0 is SurfaceFormat::B8G8R8A8, which on little endian is aliased to SurfaceFormat::A8R8G8B8_UINT32 and equivalent to CAIRO_FORMAT_ARGB32,
which makes the conversion function at gfx/2d/HelpersCairo.h line 139 work normally:
---8<---
static inline cairo_format_t GfxFormatToCairoFormat(SurfaceFormat format) {
  switch (format) {
    case SurfaceFormat::A8R8G8B8_UINT32:
      return CAIRO_FORMAT_ARGB32;
    case SurfaceFormat::X8R8G8B8_UINT32:
      return CAIRO_FORMAT_RGB24;
    case SurfaceFormat::A8:
      return CAIRO_FORMAT_A8;
    case SurfaceFormat::R5G6B5_UINT16:
      return CAIRO_FORMAT_RGB16_565;
    default:
      gfxCriticalError() << "Unknown image format " << (int)format;
      return CAIRO_FORMAT_ARGB32;
  }
}
---8<---
However, on big endian the CAIRO_FORMAT_ARGB32 and SurfaceFormat::A8R8G8B8_UINT32 formats correspond to SurfaceFormat::A8R8G8B8 (4)
instead.  This is the format that needs to be used, as SurfaceFormat::B8G8R8A8 would correspond to CAIRO_FORMAT_BGRA32, which does not exist.  Cairo requires the alpha bits to be in the MSBs for 32-bit formats.

Reproducible: Always

Steps to Reproduce:
1.Build firefox 102 on ppc64 (big endian).  Note that two patches from https://bugs.gentoo.org/873340 are needed to fix webrtc related build failures.
2.Start firefox
3.
Actual Results:  
A window opens but immediately closes, and the terminal shows a critical error and segfault

Expected Results:  
The firefox window stays open and lets me browse the WWW.

Portage 3.0.30 (python 3.10.6-final-0, default/linux/ppc64/17.0/desktop, gcc-11.3.0, glibc-2.35-r8, 5.4.206 ppc64)
=================================================================
System uname: Linux-5.4.206-ppc64-POWER9,_altivec_supported-with-glibc2.35
KiB Mem:   133525632 total,  25488448 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Wed, 28 Sep 2022 08:30:01 +0000
Head commit of repository gentoo: 57b274532b1819b04b096a8a77fb3933fea0f1a9
sh bash 5.1_p16-r1
ld GNU ld (Gentoo 2.38 p4) 2.38
app-misc/pax-utils:        1.3.4::gentoo
app-shells/bash:           5.1_p16-r1::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.1-r3::gentoo
dev-lang/python:           2.7.18_p15::gentoo, 3.10.6_p2::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/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: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: yes

zeldin
    location: /usr/local/portage
    masters: gentoo

crossdev
    location: /usr/local/portage-crossdev
    masters: gentoo
    priority: 10

pike
    location: /var/lib/layman/pike
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="ppc64"
ACCEPT_LICENSE="@FREE"
CBUILD="powerpc64-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mcpu=power9"
CHOST="powerpc64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -mcpu=power9"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask"
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"
FCFLAGS="-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 strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="sv_SE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j50"
PKGDIR="/usr/portage/packages"
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="/tmp/"
SHELL="/bin/tcsh"
USE="X a52 aac acl alsa big-endian bluetooth branding bzip2 cairo cdda cdr ckj cli crypt cups dbus dri dts dvd dvdr elogind encode exif flac fortran gdbm gif gnutls gpm gtk gui ibm iconv icu idn ipv6 jpeg lcms libffi libglvnd libnotify lua mad mng mp3 mp4 mpeg mule multitarget ncurses nis nls nptl offensive ogg opengl openmp pam pango pcre pdf png policykit ppc64 ppds qt5 readline sdl seccomp smp spell split-usr ssl startup-notification svg theora threads tiff truetype udev udisks unicode upower usb vorbis wxwidgets x264 xattr xcb xemacs xml xv xvid zlib" 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_PPC="altivec vsx vsx2 vsx3" 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="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="fbdev radeon r600" 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, 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 1 Joonas Niilola gentoo-dev 2022-10-06 16:16:07 UTC
I wonder if this is due to the patches we added, or if we missed something... does either esr or rapid work? I have no clue really, not much to search upstream bugzilla either. If you find patches that help, I can add them to our patch set.
Comment 2 Marcus Comstedt 2022-10-06 20:05:56 UTC
esr (102.3.0) is the one I tested.  rapid (105.0.1) has the same issue,
and is also affected by bug #873340, although only the first half and
not the DesktopCapturer bit.
Comment 3 Joonas Niilola gentoo-dev 2022-10-09 12:30:38 UTC
If it's webrtc related, I wonder if we should just disable webrtc on ppc64? AFAIK it doesn't even have the media sandbox available on ppc64 making webrtc a bit more unsecure on ppc64.
Comment 4 Marcus Comstedt 2022-10-09 17:17:42 UTC
Personally I don't care either way as I don't use webrtc (if it's easy to disable maybe have a use flag for it and everybody who doesn't care about webrtc can just turn it off regardless of arch?).  The webrtc patch seems rather straightforward though; the image format regression appears more complex IMO.
Comment 5 Larry the Git Cow gentoo-dev 2022-10-18 12:54:52 UTC
The bug has been referenced in the following commit(s):

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

commit d52d5a3733acdf481f514dd1e7733d438a33941a
Author:     Joonas Niilola <juippis@gentoo.org>
AuthorDate: 2022-10-18 12:49:49 +0000
Commit:     Joonas Niilola <juippis@gentoo.org>
CommitDate: 2022-10-18 12:54:47 +0000

    www-client/firefox: add 106.0
    
     - add a patch to update bindgen cargo crate,
     - llvm:15 can't still be enabled due to rust lacking support - it wouldn't
       work for everyone,
     - pinned lld dependencies on slots, now that lld is gloriously slotted,
     - rebased our no-warnings-as-errors patch,
     - rebased our system-av1 patch,
     - upstream enabled support for mold linker, but we can't enable it yet
       (easily) before support is added to toolchain-funcs.eclass. Track the
       support in bug #877539.
    
    Bug: https://bugs.gentoo.org/873823
    Bug: https://bugs.gentoo.org/877539
    Closes: https://bugs.gentoo.org/877267
    Signed-off-by: Joonas Niilola <juippis@gentoo.org>

 www-client/firefox/Manifest             |   99 +++
 www-client/firefox/firefox-106.0.ebuild | 1321 +++++++++++++++++++++++++++++++
 2 files changed, 1420 insertions(+)