Created attachment 872336 [details] Backtrace This wasn't happening to me before, but now when FFmpeg tries to decode AAC (always with the FFmpeg command-line tool, most of the time with Audacity) it results in a crash. I've attached a full backtrace, strace and two emerge --infos (one is for my debugging make.conf, the other is for my standard make.conf) in this bug report. I assure this bug happens with both of my make.confs.
Created attachment 872337 [details] emerge --info (debug make.conf)
Created attachment 872338 [details] emerge --info (standard make.conf)
Created attachment 872339 [details] strace
Thanks. We've seen this come up a few times recently. My guess is the reason it's happening (more) now is gcc 13 being recently stabled. It seems to be related to a mismatch between CPU_FLAGS_X86 and CFLAGS -march. Someone gave us Valgrind output before and it looked fairly clearly like an alignment problem. For a workaround: please set CPU_FLAGS_X86 per app-portage/cpuid2cpuflags output.
From your emerge --info: > CPU_FLAGS_X86="mmx mmxext sse sse2" So that's the immediate cause.
(In reply to Sam James from comment #4) > Thanks. > > We've seen this come up a few times recently. > > My guess is the reason it's happening (more) now is gcc 13 being recently > stabled. > > It seems to be related to a mismatch between CPU_FLAGS_X86 and CFLAGS > -march. Someone gave us Valgrind output before and it looked fairly clearly > like an alignment problem. > > For a workaround: please set CPU_FLAGS_X86 per app-portage/cpuid2cpuflags > output. (In reply to Paul Zander from comment #5) > From your emerge --info: > > CPU_FLAGS_X86="mmx mmxext sse sse2" > So that's the immediate cause. Sorry for the late reply, I wasn't bothered to se CPU_FLAGS_X86 until now. But I've set it and the crash went away. This seems to prove that the crash is ebuild or GCC 13-related.
Can confirm a) the error and b) the workaround. With gcc 12, everything runs fine - just like that. With gcc 13 and just the usual CFLAGS="-march=native -O2 -pipe" CXXFLAGS="${CFLAGS}" MAKEOPTS="-j2" CHOST="x86_64-pc-linux-gnu" I get Oct 29 11:16:08 home01 kernel: traps: minidlnad[11961] general protection fault ip:7f44fcc1e2ea sp:7f44fbf48e20 error:0 in libavcodec.so.60.3.100[7f44fcbb2000+73b000] and Oct 29 17:02:12 home01 kernel: traps: ffmpeg[25236] general protection fault ip:7f349ddb12ea sp:7fff1726b400 error:0 in libavcodec.so.60.3.100[7f349dd45000+73b000] With gcc 13 and additional CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" (the output of cpuid2cpuflags), everything runs fine with gcc 13, too. Here are the cpu_flags differences (equery u ffmpeg): U I - - cpu_flags_x86_3dnow : Use the 3DNow! instruction set - - cpu_flags_x86_3dnowext : Use the Enhanced 3DNow! instruction set + - cpu_flags_x86_aes : Enable support for Intel's AES instruction set (AES-NI) + - cpu_flags_x86_avx : Adds support for Advanced Vector Extensions instructions + - cpu_flags_x86_avx2 : Adds support for Advanced Vector Extensions 2 instructions + - cpu_flags_x86_fma3 : Use the Fused Multiply Add 3 instruction set ([fma] in cpuinfo) - - cpu_flags_x86_fma4 : Use the Fused Multiply Add 4 instruction set + + cpu_flags_x86_mmx : Use the MMX instruction set + + cpu_flags_x86_mmxext : Use the Extended MMX instruction set (a subset of SSE) ([mmxext] or [sse] in cpuinfo) + + cpu_flags_x86_sse : Use the SSE instruction set + + cpu_flags_x86_sse2 : Use the SSE2 instruction set + - cpu_flags_x86_sse3 : Use the SSE3 instruction set ([pni] in cpuinfo, NOT ssse3) + - cpu_flags_x86_sse4_1 : Enable SSE4.1 instruction support + - cpu_flags_x86_sse4_2 : Enable SSE4.2 instruction support + - cpu_flags_x86_ssse3 : Use the SSSE3 instruction set (NOT sse3/pni) - - cpu_flags_x86_xop : Enable the XOP instruction set (column "I" is the standard installation without CPU_FLAGS_X86) Thank you for the workaround, now I can delete gcc 12.
https://ffmpeg.org/pipermail/ffmpeg-devel/2023-December/317729.html
*** Bug 918964 has been marked as a duplicate of this bug. ***
Vlc continues to crash when opening AAC audio mp4. Pursuant to the information contained in this bug report I added CPU_FLAGS_X86 to make.conf: CFLAGS="-march=native -O2 -pipe" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" CXXFLAGS="${CFLAGS}" MAKEOPTS="-j2" # WARNING: consult http://www.gentoo.org/doc/en/change-chost.xml before changing CHOST. CHOST="x86_64-pc-linux-gnu" deleted and emerged both ffmpeg and vlc: media-video/ffmpeg-6.1-r3::gentoo was built with the following: USE="X alsa bzip2 dav1d encode gnutls gpl iconv jack lcms libass lzma modplug mp3 network opengl opus oss postproc pulseaudio theora threads truetype v4l vaapi vdpau vorbis vpx webp x264 xvid zlib -amf -amr -amrenc (-appkit) -bluray -bs2b -cdio -chromaprint -chromium -codec2 -cpudetection -cuda -debug -doc -fdk -flite -fontconfig -frei0r -fribidi -gcrypt -glslang -gme -gmp -gsm -hardcoded-tables -iec61883 -ieee1394 -jpeg2k -jpegxl -kvazaar -ladspa -libaom -libaribb24 -libcaca -libdrm -libilbc -libplacebo -librtmp -libsoxr -libtesseract -libv4l -libxml2 -lv2 (-mipsdspr1) (-mipsdspr2) (-mipsfpu) (-mmal) -nvenc -openal -opencl -openh264 -openssl -pic -qsv -rav1e -rubberband -samba -sdl -shaderc -snappy -sndio -speex -srt -ssh -static-libs -svg -svt-av1 -test -twolame -verify-sig -vidstab -vmaf -vulkan -x265 -zeromq -zimg -zvbi" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 -aes -avx -avx2 -fma3 -fma4 -sse3 -sse4_1 -sse4_2 -ssse3 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher" FEATURES="ebuild-locks merge-sync protect-owned userpriv usersandbox strict news xattr candy unmerge-logs distlocks config-protect-if-modified network-sandbox unmerge-orphans sandbox unknown-features-warn ipc-sandbox assume-digests qa-unresolved-soname-deps binpkg-dostrip multilib-strict binpkg-docompress binpkg-multi-instance nodoc pid-sandbox buildpkg-live fixlafiles pkgdir-index-trusted preserve-libs sfperms parallel-fetch usersync binpkg-logs" desconosido / # sudo emerge --info vlc Portage 3.0.58 (python 3.10.13-final-0, default/linux/amd64/17.1/systemd/merged-usr, gcc-13, glibc-2.38-r2, 6.7.0-rc1 x86_64) ================================================================= System Settings ================================================================= System uname: Linux-6.7.0-rc1-x86_64-with-glibc2.38 KiB Mem: 3901580 total, 682280 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Tue, 19 Dec 2023 15:00:01 +0000 Head commit of repository gentoo: 8817a6cb6beab2104b7d4c90b3bb2280391e8e90 Timestamp of repository 4nykey: Sun, 17 Dec 2023 11:32:15 +0000 Head commit of repository 4nykey: 66d470ff2d7685ed7296ada3621709c6b74386f0 Timestamp of repository zugaina: Fri, 16 Jun 2023 08:32:15 +0000 Head commit of repository zugaina: a31fcec20b159a13ccd069d4e13b92d18bc0ffec sh bash 5.2_p21-r1 ld GNU ld (Gentoo 2.41 p4) 2.41 app-misc/pax-utils: 1.3.7::gentoo app-shells/bash: 5.2_p21-r1::gentoo dev-lang/perl: 5.38.2-r1::gentoo dev-lang/python: 3.10.13::gentoo dev-lang/rust-bin: 1.74.1::gentoo dev-util/cmake: 3.28.1::gentoo dev-util/meson: 1.3.0-r2::gentoo sys-apps/baselayout: 2.14-r1::gentoo sys-apps/sandbox: 2.38::gentoo sys-apps/systemd: 255.1::gentoo sys-devel/autoconf: 2.13-r8::gentoo, 2.71-r7::gentoo sys-devel/automake: 1.16.5-r1::gentoo sys-devel/binutils: 2.41-r3::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/gcc: 13.2.1_p20230826::gentoo sys-devel/gcc-config: 2.11::gentoo sys-devel/libtool: 2.4.7-r1::gentoo sys-devel/llvm: 16.0.6::gentoo sys-devel/make: 4.4.1-r1::gentoo sys-kernel/linux-headers: 5.15::gentoo (virtual/os-headers) sys-libs/glibc: 2.38-r2::gentoo sys-libs/libselinux: 3.5-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage masters: gentoo priority: -1000 volatile: True sync-rsync-extra-opts: sync-rsync-verify-metamanifest: no sync-rsync-verify-max-age: 3 sync-rsync-verify-jobs: 1 4nykey location: /var/db/repos/4nykey sync-type: git sync-uri: https://github.com/gentoo-mirror/4nykey.git masters: gentoo volatile: False overlay location: /usr/local/portage/overlay masters: gentoo priority: 0 volatile: True zugaina location: /var/db/repos/zugaina sync-type: git sync-uri: https://github.com/gentoo-mirror/zugaina.git masters: gentoo volatile: False ACCEPT_KEYWORDS="amd64 ~amd64 ~x86" ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-march=native -O2 -pipe" CHOST="x86_64-pc-linux-gnu" 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" CXXFLAGS="-march=native -O2 -pipe" DISTDIR="/usr/portage/distfiles" EMERGE_DEFAULT_OPTS="--getbinpkg=y" 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="-O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live candy config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news nodoc parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo https://mirror.ufro.cl/gentoo/" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LEX="flex" LINGUAS="en" MAKEOPTS="-j2" PKGDIR="/data/cache/binpkgs" PORTAGE_BINHOST="http://packages.gentooexperimental.org/amd64-stable/" 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="/usr/tmp/portage" SHELL="/bin/bash" USE="(-selinux) X a52 aac accessibility acl alsa alsa_pcm_plugins_adpcm alsa_pcm_plugins_alaw alsa_pcm_plugins_asym alsa_pcm_plugins_copy alsa_pcm_plugins_dmix alsa_pcm_plugins_dshare alsa_pcm_plugins_dsnoop alsa_pcm_plugins_empty alsa_pcm_plugins_extplug alsa_pcm_plugins_file alsa_pcm_plugins_hooks alsa_pcm_plugins_iec958 alsa_pcm_plugins_ioplug alsa_pcm_plugins_ladspa alsa_pcm_plugins_lfloat alsa_pcm_plugins_linear alsa_pcm_plugins_meter alsa_pcm_plugins_mmap_emul alsa_pcm_plugins_mulaw alsa_pcm_plugins_multi alsa_pcm_plugins_null alsa_pcm_plugins_plug alsa_pcm_plugins_rate alsa_pcm_plugins_route alsa_pcm_plugins_share alsa_pcm_plugins_shm alsa_pcm_plugins_softvol amd64 aom apparmor argon2 audit avif branding build bzip2 cdda cli crypt cryptsetup curl dbus dri dts dv dvb dvd dynamic elfutils example fbcon fbcondecor ffmpeg flac fortran gdbm gif gimp gnuefi gstreamer gtk gtk3 http iconv idn importd introspection ipv6 iwd jack jpeg kdbus kmod lame lcms libass libidn2 libnotify libtirpc libvisual livecd loop-aes lz4 lz5 lzma matroska mms mmx mng modplug modules mp3 mp4 mpeg mpeg2 mpeg4pt2 multilib nat ncurses networkmanager nls nptl nptlonly ogg opengl openmp opus oss pam pax_kernel pcre png policykit portaudio pulseaudio qrcode qt5 readline resolvconf seccomp socks5 sse sse2 ssl systemd sysv-utils taglib test-rust theora tiff truetype udev unicode usb usrmerge v4l vaapi vala vanilla vcd vdpau vlc vorbis vpx wavpack webp x264 xattr xkb xml xvid zlib" ABI_X86="64" ADA_TARGET="gnat_2021" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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="mmx sse sse2 3dnow 3dnowext mmxext" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 ntrip navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="evdev keyboard mouse synaptics virtualbox mutouch vmmouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-1" POSTGRES_TARGETS="postgres15" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" RUBY_TARGETS="ruby31 ruby32" VIDEO_CARDS="fbdev intel i915 i965" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto 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, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS ================================================================= Package Settings ================================================================= media-video/vlc-3.0.20-r2::gentoo was built with the following: USE="X a52 alsa aom dbus dts dvbpsi dvd encode ffmpeg flac gcrypt gstreamer gui jack jpeg libass libnotify libsamplerate matroska modplug mp3 mpeg ncurses ogg opus png pulseaudio ssl taglib theora truetype udev v4l vaapi vdpau vpx x264 xml -archive -aribsub -bidi -bluray -cddb -chromaprint -chromecast -dav1d -dc1394 -debug (-directx) -faad -fdk -fluidsynth -fontconfig -gme -ieee1394 -kate -keyring -libcaca -libtar -libtiger -linsys -lirc -live -lua -macosx-notifications -mad -mtp -musepack -nfs -omxil -optimisememory -projectm -rdp -run-as-root -samba -sdl-image -sftp -shout -sid -skins -soxr -speex -srt -svg -test -tremor -twolame -upnp -vnc -wayland -x265 -zeroconf -zvbi" ABI_X86="(64)" CPU_FLAGS_X86="mmx sse" LUA_SINGLE_TARGET="lua5-1" CFLAGS="-march=native -O2 -pipe -ggdb3 -fno-strict-aliasing" CXXFLAGS="-march=native -O2 -pipe -ggdb3 -fno-strict-aliasing" FEATURES="distlocks news nodoc assume-digests unknown-features-warn splitdebug binpkg-multi-instance protect-owned multilib-strict ebuild-locks config-protect-if-modified ipc-sandbox usersync unmerge-logs xattr sfperms usersandbox pid-sandbox binpkg-docompress unmerge-orphans network-sandbox preserve-libs merge-sync pkgdir-index-trusted compressdebug sandbox binpkg-logs strict parallel-fetch userpriv buildpkg-live candy fixlafiles qa-unresolved-soname-deps binpkg-dostrip" LDFLAGS="-Wl,-O1 -Wl,--as-needed -L/usr/lib64/sidplay/builders/" compiled with: sys-devel/gcc-13.2.1_p20230826::gentoo was built with the following: USE="(cxx) fortran (multilib) nls nptl openmp (pie) sanitize ssp -ada (-cet) (-custom-cflags) -d -debug -default-stack-clash-protection -default-znow -doc (-fixed-point) -go -graphite -hardened (-ieee-long-double) -jit (-libssp) -lto -modula2 -objc -objc++ -objc-gc (-pch) -pgo -systemtap -test -valgrind -vanilla -vtv -zstd" ABI_X86="(64)" CFLAGS="-pipe -O2" CXXFLAGS="-pipe -O2" FEATURES="distlocks buildpkg protect-owned userpriv buildpkg-live pid-sandbox binpkg-docompress sandbox unmerge-logs preserve-libs config-protect-if-modified qa-unresolved-soname-deps multilib-strict assume-digests ipc-sandbox xattr merge-sync binpkg-dostrip network-sandbox parallel-fetch unmerge-orphans ebuild-locks unknown-features-warn sfperms strict binpkg-logs fixlafiles usersync usersandbox userfetch" My original repot marked as duplicate: https://bugs.gentoo.org/918964
Your output still says ffmpeg was build without setting CPU_FLAGS_X86. The CPU_FLAGS_X86="-avx" in combination with C{,XX}FLAGS="-march=native" is the cause of the segfault you see. Please rebuild ffmpeg and ensure that the CPU_FLAGS_X86 you said you have set are applied.
I am concluding from the comment regading ffmpeg built with -avx that ffmpeg needs to be built with avx and/or avx2. As it appears in make.conf: CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" added to make.conf: FFMPEG_USE="avx avx2" and added to package.use: media-video/ffmpeg avx avx2 emerge ffmpeg from command line: CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" sudo emerge -a =media-video/ffmpeg-6.1-r3 However after rebuilding ffmpeg the following reference to -avx shows in the build info: media-video/ffmpeg-6.1-r3::gentoo was built with the following: USE="X alsa bzip2 dav1d encode gnutls gpl iconv jack lcms libass lzma modplug mp3 network opengl opus oss postproc pulseaudio theora threads truetype v4l vaapi vdpau vorbis vpx webp x264 xvid zlib -amf -amr -amrenc (-appkit) -bluray -bs2b -cdio -chromaprint -chromium -codec2 -cpudetection -cuda -debug -doc -fdk -flite -fontconfig -frei0r -fribidi -gcrypt -glslang -gme -gmp -gsm -hardcoded-tables -iec61883 -ieee1394 -jpeg2k -jpegxl -kvazaar -ladspa -libaom -libaribb24 -libcaca -libdrm -libilbc -libplacebo -librtmp -libsoxr -libtesseract -libv4l -libxml2 -lv2 (-mipsdspr1) (-mipsdspr2) (-mipsfpu) (-mmal) -nvenc -openal -opencl -openh264 -openssl -pic -qsv -rav1e -rubberband -samba -sdl -shaderc -snappy -sndio -speex -srt -ssh -static-libs -svg -svt-av1 -test -twolame -verify-sig -vidstab -vmaf -vulkan -x265 -zeromq -zimg -zvbi" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 -aes -avx -avx2 -fma3 -fma4 -sse3 -sse4_1 -sse4_2 -ssse3 -xop" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher" FEATURES="unmerge-logs binpkg-docompress userpriv qa-unresolved-soname-deps usersync parallel-fetch strict xattr protect-owned candy sfperms ebuild-locks fixlafiles config-protect-if-modified nodoc network-sandbox usersandbox sandbox binpkg-logs pid-sandbox unmerge-orphans assume-digests preserve-libs ipc-sandbox unknown-features-warn binpkg-multi-instance pkgdir-index-trusted distlocks multilib-strict news binpkg-dostrip merge-sync buildpkg-live" How to eliminate the -avx reference when compiling?
Follow https://wiki.gentoo.org/wiki/CPU_FLAGS_*#Invocation. Putting `CPU_FLAGS_X86=` in make.conf is the old method that still works but often leads to confusion. Otherwise join #gentoo on irc and get help there.
# cpuid2cpuflags CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3 # sudo echo "*/* $(cpuid2cpuflags)" > /etc/portage/package.use/00cpu-flags # cat /etc/portage/package.use/00cpu-flags */* CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3 # sudo emerge -a =media-video/ffmpeg-6.1-r3 # sudo emerge --info ffmpeg still showing -avx: media-video/ffmpeg-6.1-r3::gentoo was built with the following: USE=...CPU_FLAGS_X86="3dnow 3dnowext mmx mmxext sse sse2 -aes -avx -avx2 -fma3 -fma4 -sse3 -sse4_1 -sse4_2 -ssse3 -xop"...
Without the output from `emerge -pv =media-video/ffmpeg-6.1-r3` and `emerge --info ffmpeg` this means nothing. Please attach that as files.
Created attachment 880232 [details] emerge -pv and emege --info for ffmpeg Requested info emerge -pv and emerge --info ffmpeg
CPU_FLAGS_X86 clearly isn't set one way or another. Please take this to the IRC channel or forums. Thanks.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e4da320675b49841b4e7f477a6efe3c0413f674 commit 4e4da320675b49841b4e7f477a6efe3c0413f674 Author: Sam James <sam@gentoo.org> AuthorDate: 2024-02-29 05:42:04 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2024-02-29 05:44:22 +0000 media-video/ffmpeg: fix crash when CPU_FLAGS_x86 and CFLAGS disagree When CPU_FLAGS_X86 was set to the default for amd64 and CFLAGS was higher with e.g. -march=native including AVX, we could get crashes because we disable intrinsics which would otherwise adjust the alignment ffmpeg requests. Backport an upstream patch for more sensible behaviour. Note that the upstream patch doesn't apply to 4.4.x but I haven't tried to backport it manually. Someone is welcome to, but 4.4.x should really be on its way out by now. Bug: https://trac.ffmpeg.org/ticket/10549 Bug: https://bugs.gentoo.org/915384 Signed-off-by: Sam James <sam@gentoo.org> media-video/ffmpeg/ffmpeg-6.0.1-r3.ebuild | 607 ++++++++++++++++++++ media-video/ffmpeg/ffmpeg-6.1.1-r4.ebuild | 614 +++++++++++++++++++++ .../ffmpeg/files/ffmpeg-6.0.1-alignment.patch | 114 ++++ 3 files changed, 1335 insertions(+)
I'll leave this open for a little bit for visibility and in case anyone wants to do the 4.4.x backport.
Created attachment 906471 [details] emerge --info ffmpeg
I am getting very similar issue with ffmpeg 6.1.2 compiled with GCC-14.2.1 CPU_FLAGS_X86 are set correctly as I understand Failed command: ffmpeg -hide_banner -hwaccel auto -loglevel error -i demo.mp4 -pix_fmt rgb24 temp/demo/%04d.png Segmentation fault (core dumped) Output of cpuid2cpuflags: CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3 emerge --info ffmpeg: https://bugs.gentoo.org/attachment.cgi?id=906471 dmesg: [ 730.867908] av:h264:df1[32931]: segfault at 0 ip 00007f6def75883e sp 00007f6dc7ffd750 error 4 in libavcodec.so.60.31.102[68b83e,7f6def0db000+804000] likely on CPU 5 (core 5, socket 0) [ 730.867918] Code: 41 5d 41 5e c3 0f 1f 80 00 00 00 00 f3 0f 1e fa 55 48 89 e5 41 57 49 89 d7 41 56 41 55 4d 89 c5 41 54 49 89 f4 53 48 83 ec 28 <48> 8b 1a 48 89 7c 24 08 48 89 4c 24 18 48 83 3b 00 0f 84 33 04 00
Comment on attachment 906471 [details] emerge --info ffmpeg I am getting very similar issue with ffmpeg 6.1.2 compiled with GCC-14.2.1 CPU_FLAGS_X86 are set correctly as I understand Failed command: ffmpeg -hide_banner -hwaccel auto -loglevel error -i demo.mp4 -pix_fmt rgb24 temp/demo/%04d.png Segmentation fault (core dumped) Output of cpuid2cpuflags: CPU_FLAGS_X86: aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3 emerge --info ffmpeg: https://bugs.gentoo.org/attachment.cgi?id=906471 dmesg: [ 730.867908] av:h264:df1[32931]: segfault at 0 ip 00007f6def75883e sp 00007f6dc7ffd750 error 4 in libavcodec.so.60.31.102[68b83e,7f6def0db000+804000] likely on CPU 5 (core 5, socket 0) [ 730.867918] Code: 41 5d 41 5e c3 0f 1f 80 00 00 00 00 f3 0f 1e fa 55 48 89 e5 41 57 49 89 d7 41 56 41 55 4d 89 c5 41 54 49 89 f4 53 48 83 ec 28 <48> 8b 1a 48 89 7c 24 08 48 89 4c 24 18 48 83 3b 00 0f 84 33 04 00
Can you file a separate bug please? I suspect it might be different.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=00eddc65d7bd9ecaa9973fd46e544bbbfe5c9479 commit 00eddc65d7bd9ecaa9973fd46e544bbbfe5c9479 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2025-03-07 13:02:23 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2025-03-11 09:03:17 +0000 media-video/ffmpeg: rewrite live ebuild This does not list all changes compared to original due to being essentially a rewrite (not much sense in looking at the diff given almost no lines in common), but to list or explain notable ones: * Cleanup a lot of obsolete logic, like mirror://gentoo snapshots, SCM type, <openssl-3 handling, etc... * Re-arrange IUSE=soc handling to drop the IUSE when FFMPEG_SOC_PATCH is empty until maintainer of the patch has time to look at that (easier to bump without it and removes the need to mask in 9999) * Drop some IUSE, ffmpeg has a bit too many often confusing users and, while debatable, some are not really useful to control bare at most for expert user that could use EXTRA_ECONF if *really* wanted: - debug (disabled): does very little beside override users' -g*, albeit if want nasm debug symbols will need to set X86ASMFLAGS. - encode (enabled): debated keeping it for disabling encoders without their own USE for bit of size/build time reduction despite no dependencies, but feel it is not really worth it as it complicates the ebuild and can break expectations for a lot of revdeps (many likely lack the [encode] that they need) -- removal also handles bug #770439 - fftools_* (disabled): almost no distros install these, many have rather generic names, we were missing installing new ones, upstream ffmpeg does not even have an install target for them, and a global USE_EXPAND for this feels wasteful (*could* consider adding a all-in-one IUSE=tools if some are wanted by users anyway but let us try without and see if anyone complains) - glslang (disabled): redundant with USE=shaderc and is a pain to use directly given glslang often breaks things, esp. worse for packages with a slow release cycle and old LTS versions like ffmpeg (bug #918989, bug #920283, bug #922333, bug #922433) -- upstream also seems to favour shaderc: "libshaderc and libglslang are mutually exclusive, if in doubt, disable libglslang" (from ./configure) - harcoded-tables (disabled): off by default upstream and listed as a "experts only" option that seemingly provide little gains for a notable size increase, do not believe it is worth exposing as a USE - iconv (enabled): virtual/libiconv is essentially free anywhere but prefix and disabling iconv can be rather broken for a few things - network (enabled): no dependencies, fairly small, and many revdeps likely expect it to be enabled and just missing the [network] (tempting to do the same with USE=postproc but it would still be conditional through USE=gpl and be more confusing, and then forcing GPL also has its own issues) - oss (auto): does not have a dedicated option and just checks linux-headers and is very small, hardly anyone need this but that argument could be applied to a *ton* of in/outdevs, filters, de/encoders, and such and we would never see the end of it - pic (enabled): makes little sense not to enable nowadays and handles bug #903754 + bug #916067 -- USE had the secondary effect of disabling x86-32 asm which still doing given it is difficult to support either way due to textrels and >=binutils-2.41's enforcing (bug #916067, bug #920808), and it is possibly broken for older hardware (bug #733556) -- as a minor bonus, this should also let LTO work with abi_x86_32 (bug #654118) - static-libs (disabled): cannot think of much of a use for this esp. given how massive these libraries are and it would still require to link with all its shared-only dependencies - test (irrelevant): tests are not gone but there is no dependencies (bc and wget are not needed) nor REQUIRED_USE to handle anymore, thus USE is useless - threads (auto): no real sense in disabling (bug #868471), and leaving it auto let ffmpeg figure out the right implementation to use which in most cases means default --enable-pthreads - cpu_flags_* + cpudetection (enabled): tentatively anyway, just let ffmpeg do its thing normally -- simplifies the ebuild a lot, "should" fix bug #915384, and also handles whatever ebuild was doing wrong wrt bug #752507 + bug #778035 (one minor "issue" however is that all these flags being removed will leave users confused as to what happened, if reading this and worried about optimizations.. then no they are *not* disabled, and it is fine for other machines thanks to detection at runtime) * New IUSE: - openmpt: requested in bug #921313 - npp: requested in bug #695210 -- note have not tested the arm64 (sbsa) support, but it should work in theory as cuda toolkit does install npp prebuilt arm64 libraries - rabbitmq: trivial, may as well add support (meant to add more but others did not fare as well and will leave for later rather than during big changes, kept some minor notes in the ebuild about things still not supported) * Renamed IUSE: - mp3->lame: this is only for encoding but it made it "sound" needed for decoding (not the only case like this but this one felt too generic), may surprise those that had it actually enabled for encoding - libxml2->xml and libdrm->drm: given newly enabling these by default (see below), it's a good occasion to rename to the more commonly used USE without causing issues - libv4l->v4l: to be precise IUSE=v4l was removed and it gained the meaning that IUSE=libv4l had -- old v4l is always enabled (if linux) due to the hard dependency on linux-headers (see below) -- given the old REQUIRED_USE with libv4l? ( v4l ), all users of libv4l will have the new USE enabled already - libdvdnav+libdvdread->dvd(combined): similar to mpv, simpler for users when they just want dvds to work than worry about each library (dvd support is new in ffmpeg-7, so this only ever been masked) * Enable a few extra IUSE by default that, while not everyone needs, are useful and have dependencies that many users will already have. - libass,truetype,fontconfig: for proper text/subtitles drawing (kdenlive also wants [libass]), albeit video players tend to have their own handling (that pull the same depdencies) - drm: used in various pieces of code and little reason to disable when mesa depends on libdrm either way - xml: needed for DASH-type streams, notably used by youtube, and about everyone has libxml2 (one downside of new defaults is MULTILIB_USEDEP, users that only selectively enable abi_x86_32 rather than globally may be faced with conflicts when updating) * Always depend on linux-headers if linux, not *required* (except for v4l) but this prevents a lot of automagic and going through alternate code paths if missing (also go with >=6 which is needed for v4l2m2m and I believe also USE=soc for v4l2request) * Add missing vulkan-headers dependency wrt bug #865201, and also opencl-headers wrt bug #941506 (not 100% sure that this is what happened for the latter, but given binhost is setup it is likely). * Bump nv-codec-headers min req to 12.1.14.0, while not *required* it spares us for setting up ranges and 11.x is due for cleanup. * Add missing x11-base/xorg-proto wrt bug #934196 -- technically was longer an issue given libX11 RDEPENDs on it "now", but would still rather keep these for now. * Depend on >=librsvg-2.52 wrt bug #918613, USE=svg is not essential for arches without rust and upstream bug been went 1.5 years without activity. * Update REQUIRED_USE a bit, cuda does not *need* nvenc (just get one filter in less), libplacebo does nothing without sdl(ffplay) or vulkan, and few others like these (likely still missing some). * Drop musl HAVE_POSIX_IOCTL workaround, this is automatically set by ./configure since ffmpeg-7.1. However, note that there is another related issue with libv4l (not v4l) that is not fixed (bug #911499). * No longer ignore ffmpeg-spec-disposition test, fixed in 7.1.1. * Fix verify-sig paths on prefix wrt bug #947253 (untested) * No longer pass e.g. --disable-indev=alsa when already doing --disable-alsa, ./configure seem to figure this out just fine. * No longer pass --cpu, this expects the -march=<exact> reported by the compiler or probes compiler with =native if =host), however it does not account for -mno-* both passed or implied by =native and could enable things it shouldn't. Furthermore, it adds -march=<exact> after the users' -march=native (which is more correct, can enable or disable additional features). This option only seem like trouble and likely does not get tested much. Removing also handles bug #830165 albeit ffmpeg-chromium is still affected. * Replace EXTRA_FFMPEG_CONF by EXTRA_ECONF, while it is not using econf nor autoconf, the latter is more widely known while the former needs users to look at the ebuild -- also die if old variable is set so users know about this change. * Skip installing doc/*.txt, that seems mostly oriented at ffmpeg devs, and feels noisy in the docdir, but do keep doc/APIChanges * Replace all *GPL* by the + version given ./configure always output with "or later" when listing the final license. * Maybe not best way to go about this, but when doing incompatible --enable-gpl --enable-nonfree, on top of the RESTRICT="bindist" also add "all-rights-reserved" so a typical freedom ACCEPT_LICENSE can block it. * Rearrange chromium patch a bit to need less ebuild logic, and make it unused for ffmpeg-compat. * Drop EGIT_MIN_CLONE_TYPE, shallow clones seem fine now? If not, could consider just using the official github mirror by default. List of closed bugs may not be complete, plans are to recheck still-open bugs after this is merged. Bug: https://bugs.gentoo.org/830165 Closes: https://bugs.gentoo.org/654118 Closes: https://bugs.gentoo.org/695210 Closes: https://bugs.gentoo.org/733556 Closes: https://bugs.gentoo.org/752507 Closes: https://bugs.gentoo.org/770439 Closes: https://bugs.gentoo.org/778035 Closes: https://bugs.gentoo.org/865201 Closes: https://bugs.gentoo.org/868471 Closes: https://bugs.gentoo.org/903754 Closes: https://bugs.gentoo.org/915384 Closes: https://bugs.gentoo.org/916067 Closes: https://bugs.gentoo.org/918613 Closes: https://bugs.gentoo.org/918989 Closes: https://bugs.gentoo.org/920283 Closes: https://bugs.gentoo.org/920808 Closes: https://bugs.gentoo.org/921313 Closes: https://bugs.gentoo.org/922333 Closes: https://bugs.gentoo.org/922433 Closes: https://bugs.gentoo.org/934196 Closes: https://bugs.gentoo.org/941506 Closes: https://bugs.gentoo.org/947253 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> media-video/ffmpeg/ffmpeg-9999.ebuild | 1014 +++++++++++++--------------- media-video/ffmpeg/files/chromium-r3.patch | 53 ++ media-video/ffmpeg/metadata.xml | 8 + 3 files changed, 538 insertions(+), 537 deletions(-)