Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 880989 - www-client/firefox and www-client/chromium: certain web sites crash libdav1d.so.6.6.0 on PPC
Summary: www-client/firefox and www-client/chromium: certain web sites crash libdav1d....
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: PullRequest
Depends on:
Blocks:
 
Reported: 2022-11-11 14:10 UTC by darkbasic
Modified: 2023-02-17 05:13 UTC (History)
5 users (show)

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


Attachments
chromium-dump.tar.xz (chromium-dump.tar.xz,37.42 KB, application/octet-stream)
2022-11-11 14:14 UTC, darkbasic
Details
chromium-debug-build.log.gz (build.log.gz,460.70 KB, application/gzip)
2022-11-15 07:25 UTC, darkbasic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description darkbasic 2022-11-11 14:10:04 UTC
Visiting certain pages crashes your tab, 100% of the times. I don't think it's a Firefox or Chromium issue because it happens in both browsers, so it must be one of the underlying libraries.

This is the website which triggered the crash: https://www.diptyqueparis.com/en_uk/p/eau-capitale-eau-de-parfum.html

Chromium log from start to crash:

[727063:727063:1111/144837.251023:ERROR:gpu_init.cc(537)] Passthrough is not supported, GL is egl, ANGLE is
[726948:727055:1111/144837.693260:ERROR:nss_util.cc(349)] After loading Root Certs, loaded==false: NSS error code: -8018
[727063:727063:1111/144839.268870:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[727063:727063:1111/144844.787089:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[727063:727063:1111/144844.797703:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

I've also attached the Chromium dump from the Crash Reports.

I cannot attach the Firefox dump because there is none... I thought I had to enable the Crash Reporter in about:crashes but it says "Hmm. That address doesn’t look right.".
I've tried with a clean profile and hardware acceleration disabled and Firefox still crashes the tab (without any kind of logs/dumps).

Please let me know how to further debug it.
Comment 1 darkbasic 2022-11-11 14:14:34 UTC
Created attachment 831455 [details]
chromium-dump.tar.xz

talos2 ~ # emerge --info
Portage 3.0.38.1 (python 3.10.8-final-0, default/linux/ppc64le/17.0/desktop/gnome/systemd, gcc-11.3.0, glibc-2.35-r8, 6.0.8-gentoo-dist ppc64le)
=================================================================
System uname: Linux-6.0.8-gentoo-dist-ppc64le-POWER9,_altivec_supported-with-glibc2.35
KiB Mem:    65536124 total,  63174156 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Fri, 11 Nov 2022 12:46:52 +0000
Head commit of repository gentoo: 1f2e8c8f1ba430d55fe0ee16fba422d99766c50d

Timestamp of repository bobwya: Mon, 07 Nov 2022 13:32:45 +0000
Head commit of repository bobwya: 73623f41c0ee4e63b5750227b988f38f4ae47eee

Timestamp of repository guru: Thu, 10 Nov 2022 20:06:16 +0000
Head commit of repository guru: ef4091d2d47016cb377f1a6a01d63281eec9ca85

Timestamp of repository pf4public: Fri, 11 Nov 2022 12:01:58 +0000
Head commit of repository pf4public: c337fb82ad9b0d24ee3e8085fe6a8215157e4584

sh bash 5.1_p16-r2
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-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.34.1-r4::gentoo
dev-lang/python:           3.10.8_p3::gentoo, 3.11.0_p2::gentoo
dev-lang/rust:             1.64.0-r1::gentoo
dev-util/cmake:            3.24.2::gentoo
dev-util/meson:            0.63.2-r1::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          251.4::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.4::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.4::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo, 15.0.4::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: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: yes

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

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

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

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

ACCEPT_KEYWORDS="ppc64"
ACCEPT_LICENSE="@FREE @FREE unRAR fping freedist"
CBUILD="powerpc64le-unknown-linux-gnu"
CFLAGS="-O2 -pipe -mcpu=power9 -mtune=power9"
CHOST="powerpc64le-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/php/apache2-php7.4/ext-active/ /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php7.4/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php7.4/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -mcpu=power9 -mtune=power9"
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 -pipe -mcpu=power9 -mtune=power9"
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 -mcpu=power9 -mtune=power9"
GENTOO_MIRRORS="https://gentoo.mirror.garr.it/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j32"
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 a52 aac acl alsa bluetooth branding bzip2 cairo cdda cdr cli colord crypt cups dbus dri dts dvd dvdr eds encode evo exif flac fortran gdbm gif gnome gnome-keyring gnome-online-accounts gpm gstreamer gtk gui iconv icu introspection ipv6 jpeg lcms libglvnd libnotify libsecret mad mng mp3 mp4 mpeg nautilus ncurses networkmanager nls nptl ogg opencl opengl openmp pam pango pcre pdf pipewire png policykit ppc64 ppds pulseaudio qt5 readline screencast sdl seccomp spell split-usr ssl startup-notification svg systemd test-rust tiff tracker truetype udev udisks unicode upower usb vaapi vorbis vpx vulkan wayland wxwidgets x264 xattr xcb xml xv xvid zeroconf 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" QEMU_SOFTMMU_TARGETS="ppc ppc64 i386 x86_64 arm aarch64" QEMU_USER_TARGETS="ppc ppc64 i386 x86_64 arm aarch64" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="amdgpu radeon" 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 2 Jonas Stein gentoo-dev 2022-11-11 23:40:11 UTC
can not reproduce on ~amd64. Can others confirm it on ppc?
Comment 3 Joonas Niilola gentoo-dev 2022-11-12 08:15:59 UTC
Anything in dmesg? 
What version of nss you're running? Although I doubt it's related, but when did the crashes started to occurr, what did you upgrade (check /var/log/emerge.log)?

And finally if you can, try to disable the system-* use flags and see if that helps. I have noticed crashes when system libraries are built with some weird *FLAGS configuration, but doesn't seem to be the case for you.
Comment 4 darkbasic 2022-11-12 08:52:50 UTC
> What version of nss you're running?

3.85

> Although I doubt it's related, but when did the crashes started to occurr, what did you upgrade

It always happened. Initially I was using Chromium and I thought I did something wrong forward porting the ppc64 patchset, but recently I've stumbled upon a website I *had* to visit so I fired up Firefox and noticed it was the same. Since it wasn't my Chromium patchset I've decide I could have mainlined it and now I'm investigating the crash as well.

> try to disable the system-* use flags and see if that helps

Of course, but I cannot guarantee it wll build without these. Both Firefox and Chromium ports are quite precarious to say the least on ppc64 (Firefox doesn't have JIT nor sandbox and suffered too many issues and regressions to even count them).

> Anything in dmesg?

Not sure, but I don't think so. I can't check right now because I'm recompiling world but I will check tomorrow.

By the way both Firefox and Chromium are compiled with clang, but the same issue happened with gcc (Firefox didn't even work with clang until recently because of a sqlite issue).
Comment 5 darkbasic 2022-11-13 09:27:07 UTC
> Anything in dmesg?

I was wrong, here is the output:

Firefox:

[155553.599947] dav1d-worker[3073385]: segfault (11) at 3fff74302ffe nip 3fff89c9f920 lr 3fff89c623e0 code 2 in libdav1d.so.6.6.0[3fff89c30000+9a000]
[155553.599993] dav1d-worker[3073385]: code: 1000080c 39400008 3b610070 f02002d1 f561017d 38e3fffe f5a1018d f581019d 
[155553.600023] dav1d-worker[3073385]: code: 7d4903a6 7f6adb78 f40101ad 60000000 <f4070009> 38ca0010 7ce72214 11a1010c

Chromium:

 
[155603.380834] dav1d-worker[3073771]: segfault (11) at 21940803fffe nip 3fff98eff920 lr 3fff98ec23e0 code 2 in libdav1d.so.6.6.0[3fff98e90000+9a000]
[155603.380883] dav1d-worker[3073771]: code: 1000080c 39400008 3b610070 f02002d1 f561017d 38e3fffe f5a1018d f581019d 
[155603.380916] dav1d-worker[3073771]: code: 7d4903a6 7f6adb78 f40101ad 60000000 <f4070009> 38ca0010 7ce72214 11a1010c
Comment 6 Joonas Niilola gentoo-dev 2022-11-14 07:08:57 UTC
So there's a hint. It's somehow related to system-av1 support - try recompiling media-libs/dav1d and media-libs/libaom - then try launching the browser. If it doesn't work, try recompiling the browsers again, and if that doesn't work, I'm afraid -system-av1 is the only thing left to try. 

This goes with my previous observation of system-* libs being compiled with weird settings, so check that your dav1d and libaom aren't compiled with any weird *FLAGS. Again, your emerge --info doesn't really look like that should be reason, but check you don't have package.env overrides.
Comment 7 Jonas Stein gentoo-dev 2022-11-14 07:18:12 UTC
perhaps related to #667460 or #801172?
Comment 8 darkbasic 2022-11-14 09:08:54 UTC
> This goes with my previous observation of system-* libs being compiled with
> weird settings, so check that your dav1d and libaom aren't compiled with any
> weird *FLAGS. Again, your emerge --info doesn't really look like that should be
> reason, but check you don't have package.env overrides.

Nope, these are my only overrides:

# compiler-clang: build with a general Clang environment (see Clang article)
# clang-chromium: build with tweaks specifically for Chromium

www-client/chromium compiler-clang clang-chromium

dev-qt/qtwebengine reduced-makeopts

media-libs/mesa compiler-clang




/etc/portage/env/compiler-clang:

LDFLAGS="${LDFLAGS} -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed"

# Hardening
_HARDENING_FLAGS="-fstack-protector-strong -D_FORTIFY_SOURCE=2"
CFLAGS="${CFLAGS} ${_HARDENING_FLAGS}"
CXXFLAGS="${CXXFLAGS} ${_HARDENING_FLAGS}"
LDFLAGS="${LDFLAGS} -Wl,-z,relro,-z,now"

CC="clang"
CXX="clang++"
AR="llvm-ar"
NM="llvm-nm"
RANLIB="llvm-ranlib"




/etc/portage/env/clang-chromium:

# Optionally, add these to EXTRA_GN:
# - thin_lto_enable_optimizations=true 
# - use_thin_lto=true
# - is_cfi=true 
EXTRA_GN="use_lld=true is_clang=true clang_use_chrome_plugins=false"
#
# Needed with GCC 11
CHROMIUM_FORCE_LIBCXX=yes




www-client/chromium-107.0.5304.87::gentoo was built with the following:
USE="X cups hangouts js-type-check libcxx official (pic) proprietary-codecs pulseaudio qt5 screencast suid system-av1 system-harfbuzz system-icu (system-png) vaapi wayland (-component-build) -custom-cflags -debug -gtk4 (-headless) -kerberos -lto (-pgo) (-selinux) (-system-ffmpeg) (-widevine)" L10N="af am ar bg bn ca cs da de el en-GB es es-419 et fa fi fil fr gu he hi hr hu id it ja kn ko lt lv ml mr ms nb nl pl pt-BR pt-PT ro ru sk sl sr sv sw ta te th tr uk ur vi zh-CN zh-TW"
CFLAGS="-O2 -pipe -mcpu=power9 -mtune=power9 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wno-unknown-warning-option"
CXXFLAGS="-O2 -pipe -mcpu=power9 -mtune=power9 -fstack-protector-strong -D_FORTIFY_SOURCE=2 -Wno-unknown-warning-option"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -fuse-ld=lld -Wl,--as-needed -Wl,-z,relro,-z,now"



www-client/firefox-106.0.5::gentoo was built with the following:
USE="X clang dbus gmp-autoupdate openh264 pulseaudio screencast system-av1 system-harfbuzz system-icu system-jpeg system-libevent system-libvpx system-webp wayland -debug (-eme-free) -geckodriver -hardened -hwaccel -jack -libproxy -lto -pgo (-selinux) -sndio -system-png (-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"
CFLAGS="-pipe -mcpu=power9 -mtune=power9"
CXXFLAGS="-pipe -mcpu=power9 -mtune=power9"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,--compress-debug-sections=zlib -Wl,-rpath=/usr/lib64/firefox,--enable-new-dtags"




I will try with media-libs/dav1d-9999 to see if #667460 is related or not.
I don't use LTO so #801172 should not be related unless LTO is enabled by default.
Comment 9 darkbasic 2022-11-14 10:00:04 UTC
media-libs/dav1d-9999 didn't help at all.
Instead image.avif.use-dav1d = false in Firefox about:config fixed the issue, so it's definitely a bug in dav1d ppc64.
I will try with -system-av1 but I don't think it will help at this point.
Comment 10 darkbasic 2022-11-14 10:50:06 UTC
Somehow -system-av1 did work as well on Firefox.
Comment 11 darkbasic 2022-11-14 15:01:11 UTC
-system-av1 did *NOT* fix the issue in Chromium:

[262126.833191] dav1d-worker[3524751]: segfault (11) at 21e40887fffe nip 1134181c8 lr 1134180d0 code 2 in chrome[10b35a000+10122000]
[262126.833202] dav1d-worker[3524765]: segfault (11) at 21e40923fffe nip 1134181c8 lr 1134180d0 code 2 in chrome[10b35a000+10122000]


[262126.833252] dav1d-worker[3524765]: code: 7d98f214 f0210cd7 7c585a19 7c6c5a19 3980000a 1001110c 10a1100c 1081190c 
[262126.833269] dav1d-worker[3524751]: code: 7d98f214 f0210cd7 7c585a19 7c6c5a19 3980000a 1001110c 10a1100c 1081190c 
[262126.833279] dav1d-worker[3524765]: code: 1041180c 3800fffe f45f01ad f04214d7 <7c7b0219> f49f019d 3afbfffe 7bc00fa4 
[262126.833296] dav1d-worker[3524751]: code: 1041180c 3800fffe f45f01ad f04214d7 <7c7b0219> f49f019d 3afbfffe 7bc00fa4

Slightly different segfault in dmesg but same crash.
Comment 12 Joonas Niilola gentoo-dev 2022-11-14 15:03:39 UTC
It wouldn't really surprise me if chromium heavily patched their bundled libdav1d.
Comment 13 Stephan Hartmann (RETIRED) gentoo-dev 2022-11-14 15:47:43 UTC
Nothing is patched in Chromium:

https://chromium.googlesource.com/external/github.com/videolan/dav1d
https://chromium.googlesource.com/chromium/src.git/+/refs/heads/main/third_party/dav1d

They only ship the config headers to avoid requiring meson.

We really need a backtrace. If you see an "Aw snap" then the renderer process crashed. You can get backtrace using one of the methods here:

https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/linux/debugging.md#multiprocess-tricks
Comment 14 darkbasic 2022-11-14 16:58:23 UTC
> It wouldn't really surprise me if chromium heavily patched their bundled libdav1d.

Why would you say so? Chromium's behavior is coherent with system's media-libs/dav1d (1.0.0 and git master).

On the contrary something fancy is happening with Firefox because somehow -system-av1 doesn't trigger the bug. Maybe Firefox bundles an outdated dav1d version and this is a regression? I don't know.

> We really need a backtrace. If you see an "Aw snap" then the renderer process
> crashed. You can get backtrace using one of the methods here:

I've got a backtrace using the following commands:

echo "set pagination off" > .gdbinit
chromium --no-sandbox --renderer-cmd-prefix="xterm -title renderer -e gdb -ex run --args"

Thread 24 "dav1d-worker" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x3fffe67617c0 (LWP 3581913)]
0x000000010a8b81c8 in ?? ()
(gdb) bt
#0  0x000000010a8b81c8 in  ()
#1  0x000000010a8b80d0 in  ()
#2  0x000000010a94f3f8 in  ()
#3  0x000000010a94bd18 in  ()
#4  0x000000010a9539b8 in  ()
#5  0x00003ffff572b5c8 in  () at /lib64/libc.so.6

Unfortunately this is far from being useful.

Which packages do you want me to recompile with FEATURES="nostrip" and CFLAGS="-O1 -pipe -ggdb3 -Wall"? Do you prefer to use the bundled dav1d (-system-av1) or the latest and greatest dav1d from git master (+system-av1)?
Comment 15 Joonas Niilola gentoo-dev 2022-11-14 17:37:32 UTC
(In reply to darkbasic from comment #14)
> > It wouldn't really surprise me if chromium heavily patched their bundled libdav1d.
> 
> Why would you say so? Chromium's behavior is coherent with system's
> media-libs/dav1d (1.0.0 and git master).
> 

Guess history with chromium and ffmpeg/libav.
Comment 16 darkbasic 2022-11-15 07:25:59 UTC
Created attachment 832779 [details]
chromium-debug-build.log.gz

I've tried to build chromium with -system-av1, custom-cflags and CFLAGS="-O1 -pipe -ggdb3 -Wall" but it fails:

FAILED: libvk_swiftshader.so libvk_swiftshader.so.TOC 
python3.10 "../../build/toolchain/gcc_solink_wrapper.py" --readelf="readelf" --nm="llvm-nm"  --sofile="./libvk_swiftshader.so" --tocfile="./libvk_swiftshader.so.TOC" --output="./libvk_swiftshader.so" -- clang++ -shared -Wl,-soname="libvk_swiftshader.so" -Wl,-Bsymbolic -Wl,--version-script=../../third_party/swiftshader/src/Vulkan/vk_swiftshader.lds -fuse-ld=lld -Wl,--build-id=sha1 -fPIC -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--icf=all -Wl,--color-diagnostics -Wl,--no-call-graph-profile-sort -no-canonical-prefixes -rdynamic -Wl,-z,defs -Wl,--as-needed -nostdlib++ -Wl,-O1 -Wl,--as-needed -fuse-ld=lld -rtlib=compiler-rt -unwindlib=libunwind -Wl,--as-needed -Wl,-z,relro,-z,now -o "./libvk_swiftshader.so" @"./libvk_swiftshader.so.rsp" 
ld.lld: error: undefined symbol: __register_frame
>>> referenced by RTDyldMemoryManager.cpp:127 (/var/tmp/portage/www-client/chromium-107.0.5304.87/work/chromium-107.0.5304.87/out/Release/../../third_party/swiftshader/third_party/llvm-10.0/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp:127)
>>>               obj/third_party/swiftshader/third_party/llvm-10.0/swiftshader_llvm_most/RTDyldMemoryManager.o:(llvm::RTDyldMemoryManager::registerEHFramesInProcess(unsigned char*, unsigned long))
>>> referenced by RTDyldMemoryManager.cpp:127 (/var/tmp/portage/www-client/chromium-107.0.5304.87/work/chromium-107.0.5304.87/out/Release/../../third_party/swiftshader/third_party/llvm-10.0/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp:127)
>>>               obj/third_party/swiftshader/third_party/llvm-10.0/swiftshader_llvm_most/RTDyldMemoryManager.o:(llvm::RTDyldMemoryManager::registerEHFrames(unsigned char*, unsigned long, unsigned long))

ld.lld: error: undefined symbol: __deregister_frame
>>> referenced by RTDyldMemoryManager.cpp:132 (/var/tmp/portage/www-client/chromium-107.0.5304.87/work/chromium-107.0.5304.87/out/Release/../../third_party/swiftshader/third_party/llvm-10.0/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp:132)
>>>               obj/third_party/swiftshader/third_party/llvm-10.0/swiftshader_llvm_most/RTDyldMemoryManager.o:(llvm::RTDyldMemoryManager::deregisterEHFramesInProcess(unsigned char*, unsigned long))
>>> referenced by RTDyldMemoryManager.cpp:132 (/var/tmp/portage/www-client/chromium-107.0.5304.87/work/chromium-107.0.5304.87/out/Release/../../third_party/swiftshader/third_party/llvm-10.0/llvm/lib/ExecutionEngine/RuntimeDyld/RTDyldMemoryManager.cpp:132)
>>>               obj/third_party/swiftshader/third_party/llvm-10.0/swiftshader_llvm_most/RTDyldMemoryManager.o:(llvm::RTDyldMemoryManager::deregisterEHFrames())
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 17 Stephan Hartmann (RETIRED) gentoo-dev 2022-11-15 07:44:07 UTC
Building with FEATURES=nostrip is usally enough for Chromium to get a usable backtrace. Before doing that can you try to disable asm optimizations on system dav1d. AFAICS Firefox does a generic build of dav1d on ppc64.
Comment 18 darkbasic 2022-11-15 11:46:20 UTC
This is the backtrace with with dav1d-999 (+asm) compiled with FEATURES="nostrip" and CFLAGS="-O1 -pipe -ggdb3 -Wall":

Thread 22 "dav1d-worker" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x3fffe6c8b7c0 (LWP 248752)]
copy8xN (edges=(CDEF_HAVE_RIGHT | CDEF_HAVE_BOTTOM), h=8, w=8, bottom=<optimized out>, top=<optimized out>, left=0x3fffe6c8aa40, src_stride=768, src=0x51c07e40000 "", tmp_stride=16, tmp=0x3fffe6c8a590) at ../dav1d-9999/src/ppc/cdef_tmpl.c:164
164     ../dav1d-9999/src/ppc/cdef_tmpl.c: No such file or directory.
(gdb) bt
#0  copy8xN (edges=(CDEF_HAVE_RIGHT | CDEF_HAVE_BOTTOM), h=8, w=8, bottom=<optimized out>, top=<optimized out>, left=0x3fffe6c8aa40, src_stride=768, src=0x51c07e40000 "", tmp_stride=16, tmp=0x3fffe6c8a590) at ../dav1d-9999/src/ppc/cdef_tmpl.c:164
#1  filter_8xN (tmp=0x3fffe6c8a594, tmp_stride=16, edges=(CDEF_HAVE_RIGHT | CDEF_HAVE_BOTTOM), damping=5, dir=<optimized out>, sec_strength=2, pri_strength=0, h=8, w=8, bottom=<optimized out>, top=<optimized out>, left=0x3fffe6c8aa40, dst_stride=768, dst=0x51c07e40000 "") at ../dav1d-9999/src/ppc/cdef_tmpl.c:389
#2  dav1d_cdef_filter_8x8_vsx (dst=0x51c07e40000 "", dst_stride=768, left=0x3fffe6c8aa40, top=<optimized out>, bottom=<optimized out>, pri_strength=0, sec_strength=2, dir=<optimized out>, damping=<optimized out>, edges=<optimized out>) at ../dav1d-9999/src/ppc/cdef_tmpl.c:467
#3  0x00003ffff656f08c in dav1d_cdef_brow_8bpc (tc=0x51c07080000, p=<optimized out>, lflvl=0x51c00cfc000, by_start=<optimized out>, by_end=<optimized out>, sbrow_start=<optimized out>, sby=<optimized out>) at ../dav1d-9999/src/cdef_apply_tmpl.c:240
#4  0x00003ffff658b860 in dav1d_filter_sbrow_cdef_8bpc (tc=0x51c07080000, sby=<optimized out>) at ../dav1d-9999/src/recon_tmpl.c:2117
#5  0x00003ffff65b1dd4 in dav1d_worker_task (data=0x51c07080000) at ../dav1d-9999/src/thread_task.c:849
#6  0x00003ffff5289508 in start_thread (arg=0x3fffe6c8b7c0) at pthread_create.c:442
#7  0x00003ffff533412c in clone () at ../sysdeps/unix/sysv/linux/powerpc/powerpc64/clone.S:107
Comment 19 darkbasic 2022-11-15 11:50:59 UTC
> Before doing that can you try to disable asm optimizations on system dav1d.
> AFAICS Firefox does a generic build of dav1d on ppc64.

Yes that's exactly what happens, in fact if I compile dav1d with -asm it doesn't segfault.
Comment 20 darkbasic 2022-11-15 12:04:53 UTC
Upstream issue: https://code.videolan.org/videolan/dav1d/-/issues/412
Comment 21 Larry the Git Cow gentoo-dev 2023-02-17 05:13:55 UTC
The bug has been closed via the following commit(s):

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

commit 75076124133dcc2823b99ed46273665c56fb1479
Author:     Niccolò Belli <niccolo.belli@linuxsystems.it>
AuthorDate: 2023-02-15 09:00:44 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-02-17 05:10:27 +0000

    media-libs/dav1d: add 1.1.0
    
    Signed-off-by: Niccolò Belli <niccolo.belli@linuxsystems.it>
    Closes: https://bugs.gentoo.org/880989
    Closes: https://github.com/gentoo/gentoo/pull/29590
    Signed-off-by: Sam James <sam@gentoo.org>

 media-libs/dav1d/Manifest           |  1 +
 media-libs/dav1d/dav1d-1.1.0.ebuild | 59 +++++++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+)