While trying to upgrade rust on one of my arm boards, I got the following assert: rustc: /var/tmp/portage/dev-lang/rust-1.69.0-r1/work/rustc-1.69.0-src/src/llvm-project/llvm/lib/IR/Value.cpp:1114: void llvm::ValueHandleBase::RemoveFromUseList(): Assertion `*PrevPtr == this && "List invariant broken"' failed. Reproducible: Always Steps to Reproduce: 1. Install rust as a deep dependency of certbot 2. Regular package updates Actual Results: Assert while compiling rust Expected Results: Rust compiles successfully Portage 3.0.45.3 (python 3.11.3-final-0, default/linux/arm64/17.0, gcc-12, glibc-2.36-r7, 6.1.28-gentoo aarch64) ================================================================= System uname: Linux-6.1.28-gentoo-aarch64-with-glibc2.36 KiB Mem: 16365288 total, 3790880 free KiB Swap: 0 total, 0 free Timestamp of repository gentoo: Sat, 03 Jun 2023 04:15:01 +0000 Head commit of repository gentoo: 582a8fe4b5d3695d17e579a29a14296ffaebb7a9 sh bash 5.1_p16-r4 ld GNU ld (Gentoo 2.39 p6) 2.39.0 app-misc/pax-utils: 1.3.5::gentoo app-shells/bash: 5.1_p16-r4::gentoo dev-lang/perl: 5.36.0-r2::gentoo dev-lang/python: 3.11.3::gentoo dev-lang/rust: 1.66.1::gentoo dev-util/cmake: 3.26.3::gentoo dev-util/meson: 1.1.1::gentoo sys-apps/baselayout: 2.13-r1::gentoo sys-apps/openrc: 0.46::gentoo sys-apps/sandbox: 2.29::gentoo sys-devel/autoconf: 2.71-r5::gentoo sys-devel/automake: 1.16.5::gentoo sys-devel/binutils: 2.39-r5::gentoo sys-devel/binutils-config: 5.5::gentoo sys-devel/gcc: 12.2.1_p20230428-r1::gentoo sys-devel/gcc-config: 2.10::gentoo sys-devel/libtool: 2.4.7-r1::gentoo sys-devel/make: 4.4.1-r1::gentoo sys-kernel/linux-headers: 6.1::gentoo (virtual/os-headers) sys-libs/glibc: 2.36-r7::gentoo Repositories: gentoo location: /var/db/repos/gentoo sync-type: rsync sync-uri: rsync://mirrors.tera-byte.com/gentoo-portage priority: -1000 volatile: False sync-rsync-verify-jobs: 1 sync-rsync-verify-max-age: 24 sync-rsync-verify-metamanifest: yes sync-rsync-extra-opts: Installed sets: @zfs ACCEPT_KEYWORDS="arm64" ACCEPT_LICENSE="* -@EULA" CBUILD="aarch64-unknown-linux-gnu" CFLAGS="-march=armv8-a+crypto+crc -O2 -pipe" CHOST="aarch64-unknown-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/spool/munin-async/.ssh" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo" CXXFLAGS="-march=armv8-a+crypto+crc -O2 -pipe" DISTDIR="/var/cache/distfiles" 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="-march=armv8-a+crypto+crc -O2 -pipe" FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news 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="-march=armv8-a+crypto+crc -O2 -pipe" GENTOO_MIRRORS="http://gentoo.mirrors.tera-byte.com" LANG="C.UTF8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" LEX="flex" LINGUAS="en en_CA en_US en_UTF-8" MAKEOPTS="-j4" 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 arm64 bzip2 cli crypt dri fortran gdbm iconv libtirpc ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl test-rust unicode xattr zlib" ADA_TARGET="gnat_2021" 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_ARM="edsp thumb vfp vfpv3 vfpv4 vfp-d32 aes sha1 sha2 crc32 v4 v5 v6 v7 v8 thumb2" 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" L10N="en en-CA en-US" 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_11" PYTHON_TARGETS="python3_11" RUBY_TARGETS="ruby30 ruby31" VIDEO_CARDS="fbdev dummy v4l" 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, LFLAGS, LIBTOOL, 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
Created attachment 863117 [details] Full build log
My current working theory is that this might be some obscure out of resources condition or parallel issue. I've tried to build a couple more times, only to have it bail out in other strange places. The kernel isn't registering an OOM, but I can't really explain it otherwise. Trying again with -j1, but I expect this to take 20 hours to compile.
Created attachment 863612 [details] -j1 build with 8gb arc
Created attachment 863613 [details] -j4 build with 2gb arc
Just following up on this, I've been able to build twice with -j1 and limiting zfs arc to 2gb. Adding more cpus with the reduced arc also led to a failed build. The system has 16gb of memory, and excluding arc probably only uses one or two tops. I still see no indication that I'm running out of memory, but I'm afraid I don't have a better suggestion why I get random assert/segfault/aborts while compiling.
can you try with gcc-12.3.1_p20230526 ? relevant bug: https://bugs.gentoo.org/905818
random ICE in gcc while compiling llvm it seems. could be: HW problem mem problem gcc bug with gcc-12.3.1_p20230526 you should not need to limit -j too much. -j4 with 16gb should be good. also, add swap (not on zfs/zvol preferably) even 2G swap partition can make a difference, you don't need 2xRAM swap. just enough to take occasional overflow.
Darn. Well this is annoying. The upgraded gcc also randomly failed to compile rust. That would have been the easiest, because I've run into #724314 on zen1 in the past. I actually have 3 of these boards, and after trying to install rust on another one, it compiled just fine... 8gb arc and -j4 as well. So I guess I do have some sort of memory issue after all... Funny how this is the only way it will manifest though. Thanks for taking a look.
It’s still may be misconfigured toolchain/flags. You probably want to have matching mcpu in cflags as well. It also supports + modifiers. I have a honeycomb board, I’ll look up exact flags I use and will post here, idk what board you have but march seems to be similar. After rebuilding EVERYTHING with new flags it may go away. You can also try -march=native -mcpu=native too. But at least rebuild gcc+binutils+glibc+mpfr+mpc+gmp with mcpu before retrying rust/llvm.
Reseating the memory does seem to have fixed it, I was able to roll gcc back to stable and compile rust. > I have a honeycomb board, I’ll look up exact flags I use and will post here, idk what board you have but march seems to be similar. Funny you mention Honeycomb, the boards I have are the Macchiatobin Double Shot. Sure was a pain to get a modern distro on these boards. :)