Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 842201 - media-video/ffmpeg on ia64 needs multiple gcc optimization passes disabled
Summary: media-video/ffmpeg on ia64 needs multiple gcc optimization passes disabled
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: IA64 Linux
: Normal normal (vote)
Assignee: Gentoo Media-video project
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2022-05-02 17:47 UTC by matoro
Modified: 2022-05-03 03:20 UTC (History)
2 users (show)

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


Attachments
Example build.log using just -O2 (build.log.gz,63.10 KB, application/gzip)
2022-05-02 18:36 UTC, matoro
Details
preprocessed source (evrcdec.i,335.79 KB, text/plain)
2022-05-02 18:42 UTC, matoro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description matoro archtester 2022-05-02 17:47:37 UTC
Testing =media-video/ffmpeg-4.4.1-r5 on ia64, after a lot of trial and error, I have found ALL of the following optimization passes need to be disabled in order to compile without ICE at -O2:

-fno-tree-ccp -fno-tree-dominator-opts -fno-tree-fre -fno-code-hoisting -fno-tree-pre -fno-tree-vrp

Reproducible: Always




Portage 3.0.30 (python 3.10.4-final-0, default/linux/ia64/17.0, gcc-11.3.0, glibc-2.35-r4, 5.17.5-gentoo-ia64 ia64)                                            
=================================================================                                                                                              
                         System Settings                                                                                                                       
=================================================================                                                                                              
System uname: Linux-5.17.5-gentoo-ia64-ia64-Intel-R-_Itanium-R-_Processor_9340-with-glibc2.35                                                                  
KiB Mem:    16505680 total,  12286864 free                                                                                                                     
KiB Swap:          0 total,         0 free                                                                                                                     
Timestamp of repository gentoo: Sun, 01 May 2022 17:18:07 +0000                                                                                                
Head commit of repository gentoo: b9988323c9dd3b4b70ddd5f7ba5ba313edb9eadd                                                                                     
                                                                                                                                                               
sh bash 5.1_p16                                                                                                                                                
ld GNU ld (Gentoo 2.38 p4) 2.38                                                                                                                                
app-misc/pax-utils:        1.3.4::gentoo                                                                                                                       
app-shells/bash:           5.1_p16::gentoo                                                                                                                     
dev-lang/perl:             5.34.1-r3::gentoo                                                                                                                   
dev-lang/python:           3.10.4::gentoo, 3.11.0_alpha7::gentoo                                                                                               
dev-util/cmake:            3.23.1::gentoo                                                                                                                      
dev-util/meson:            0.61.4-r2::gentoo
sys-apps/baselayout:       2.8::gentoo
sys-apps/openrc:           0.44.10::gentoo
sys-apps/sandbox:          2.29::gentoo 
sys-devel/autoconf:        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/gcc:             11.3.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.7::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.17-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.35-r4::gentoo
Repositories:
    
gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo
    sync-user: portage:portage
    priority: -1000
    sync-git-verify-commit-signature: yes

ACCEPT_KEYWORDS="ia64 ~ia64"
ACCEPT_LICENSE="@FREE"
CBUILD="ia64-unknown-linux-gnu"
CFLAGS="-O3 -pipe -mtune=itanium2"
CHOST="ia64-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O3 -pipe -mtune=itanium2"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--usepkg --autounmask=n --complete-graph --keep-going --with-bdeps=y"
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 binpkg-multi-instance buildpkg buildpkg-live compress-build-logs compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://gentoo.osuosl.org/ https://mirror.leaseweb.com/gentoo/ https://mirror.rackspace.com/gentoo/"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j16"
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="acl bash-completion bzip2 caps cli crypt dri elogind fortran gdbm gentoo-vm graphite headless-awt ia64 iconv ipv6 libbsd libglvnd libtirpc lto ncurses nls nptl openmp pam pcre pgo readline split-usr ssl symlink threads udev unicode verify-sig vhosts vim-syntax xattr 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" 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" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="void 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="ruby26 ruby27" USERLAND="GNU" 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

=================================================================
                        Package Settings
=================================================================

media-video/ffmpeg-4.4.1-r5::gentoo was built with the following:
USE="bzip2 encode gnutls gpl iconv network postproc test threads zlib -X -alsa (-amf) -amr -amrenc (-appkit) (-bluray) (-bs2b) -cdio -chromaprint -chromium -codec2 -cpudetection (-cuda) (-dav1d) -debug -doc (-fdk) (-flite) -fontconfig (-frei0r) -fribidi -gcrypt (-gme) -gmp -gsm -hardcoded-tables -iec61883 -ieee1394 (-jack) -jpeg2k -kvazaar (-ladspa) -libaom (-libaribb24) -libass -libcaca -libdrm (-libilbc) (-librtmp) -libsoxr (-libtesseract) (-libv4l) -libxml2 -lv2 -lzma (-mipsdspr1) (-mipsdspr2) (-mipsfpu) (-mmal) -modplug -mp3 (-nvenc) -openal (-opencl) -opengl -openh264 -openssl -opus -oss -pic -pulseaudio (-rav1e) -rubberband -samba -sdl (-snappy) -sndio -speex -srt (-ssh) -static-libs -svg -svt-av1 -theora -truetype -twolame (-v4l) (-vaapi) (-vdpau) -vidstab (-vmaf) -vorbis (-vp) (-vulkan) -webp -x264 -x265 -xvid -zeromq -zimg -zvbi" FFTOOLS="aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststar sidxindex trasher"
CFLAGS="-O2 -pipe -mtune=itanium2 -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-fre -fno-code-hoisting -fno-tree-pre -fno-tree-vrp"
CXXFLAGS="-O2 -pipe -mtune=itanium2 -fno-tree-ccp -fno-tree-dominator-opts -fno-tree-fre -fno-code-hoisting -fno-tree-pre -fno-tree-vrp"
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-02 18:02:21 UTC
Can you include an example of such a failure?

Also, we obviously want to report ICEs upstream, so we should do that. Wonder if there's a decent cvise alternative. For issues like this, we can cross compile and use cvise on amd64 anyway.
Comment 2 matoro archtester 2022-05-02 18:36:39 UTC
Created attachment 776153 [details]
Example build.log using just -O2
Comment 3 matoro archtester 2022-05-02 18:42:38 UTC
Created attachment 776156 [details]
preprocessed source
Comment 4 matoro archtester 2022-05-02 19:35:44 UTC
(In reply to Sam James from comment #1)
> Can you include an example of such a failure?
> 
> Also, we obviously want to report ICEs upstream, so we should do that.
> Wonder if there's a decent cvise alternative. For issues like this, we can
> cross compile and use cvise on amd64 anyway.

I just set up a chroot and crossdev for trying this, but it doesn't replicate.

(chroot) root@desktop / # ia64-unknown-linux-gnu-gcc -O2 -pipe -c evrcdec.i -o evrcdec.o
(chroot) root@desktop / # echo $?
0

matoro@ia64dev ~ $ gcc -O2 -pipe -c evrcdec.i -o evrcdec.o
free(): invalid size
during GIMPLE pass: ccp
src/libavcodec/evrcdec.c: In function ‘evrc_decode_init’:
src/libavcodec/evrcdec.c:941:1: internal compiler error: Aborted
linux-gate.so.1: Bad address
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
Comment 5 Larry the Git Cow gentoo-dev 2022-05-03 03:20:58 UTC
The bug has been closed via the following commit(s):

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

commit 8a6a5557f973bc63809f47da1da5a23e2a7e2c0a
Author:     matoro <matoro@users.noreply.github.com>
AuthorDate: 2022-05-03 02:54:12 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-05-03 03:20:41 +0000

    media-video/ffmpeg: ia64 ICE mitigations
    
    Closes: https://bugs.gentoo.org/842201
    Signed-off-by: matoro <matoro@users.noreply.github.com>
    Closes: https://github.com/gentoo/gentoo/pull/25292
    Signed-off-by: Sam James <sam@gentoo.org>

 media-video/ffmpeg/ffmpeg-4.2.4-r1.ebuild | 9 +++++++++
 media-video/ffmpeg/ffmpeg-4.3.2-r1.ebuild | 9 +++++++++
 media-video/ffmpeg/ffmpeg-4.4.1-r5.ebuild | 9 +++++++++
 media-video/ffmpeg/ffmpeg-4.4.2.ebuild    | 9 +++++++++
 media-video/ffmpeg/ffmpeg-5.0.1.ebuild    | 9 +++++++++
 5 files changed, 45 insertions(+)