Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 806094

Summary: sys-devel/gcc-9.4.0: ICE (internal compiler error: in expand_expr_real_1, at expr.c:10012) when building dev-util/android-tools-31.0.0_p1
Product: Gentoo Linux Reporter: xiaojie+bugzillagentoo
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: RESOLVED UPSTREAM    
Severity: normal CC: dirk.schneider646, jstein, marcelo.ru, sam, xiaojie+bugzillagentoo, zmedico
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102757
See Also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86216
Whiteboard: Fixed upstream in >= gcc 10
Package list:
Runtime testing required: ---
Attachments: android-tools build log
pyside2 build log
logging.ii

Description xiaojie+bugzillagentoo 2021-08-01 20:16:30 UTC
when compilind dev-util/android-tools or dev-python/pyside2, build command fails with a "ninja : subcommand failed" error.

Reproducible: Always

Steps to Reproduce:
1.emerge android-tools or pyside2
2.wait for failure
Actual Results:  
Packages not compiled/installed

Expected Results:  
Packages should be installed

Looks like https://bugs.gentoo.org/794544

# emerge --info
Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1, gcc-9.3.0, glibc-2.33-r1, 5.4.109-gentoo-LTS x86_64)
=================================================================
System uname: Linux-5.4.109-gentoo-LTS-x86_64-Intel-R-_Core-TM-_i5-4690K_CPU_@_3.50GHz-with-glibc2.33
KiB Mem:    28640712 total,  26526104 free
KiB Swap:   16777212 total,  16369532 free
Timestamp of repository gentoo: Sun, 01 Aug 2021 00:00:02 +0000
Head commit of repository gentoo: 6b04b1b76282e2ff00762239ad122467c5517e34
sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
distcc 3.4 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.34.0::gentoo
dev-lang/python:          2.7.18_p11::gentoo, 3.9.6::gentoo
dev-lang/rust:            1.53.0::gentoo
dev-util/cmake:           3.18.5::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            9.3.0-r2::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.10::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://gensync.ba-cst.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: no
    sync-rsync-verify-max-age: 24

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

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

baverlay
    location: /usr/local/layman/baverlay
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE Apache-2 BitTorrent LGPL linux-firmware linux-fw-redistributable mpeg2enc MSttfEULA no-source-code PUEL unRAR"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=native -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /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"
CXXFLAGS="-O2 -march=native -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="-j5 --load-average 10"
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 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="en_GB.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j23 --load-average 8.0"
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="/var/tmp"
USE="acl acpi alsa amd64 bzip2 cleartype cli corefonts crypt dbus dri elogind gdbm iconv libglvnd libtirpc minimal multilib ncurses nls nptl openmp pam pcre pulseaudio qt5 readline seccomp smp split-usr ssl tcpd truetype udev unicode xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" 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_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sse sse2 sse3 sse4_1 sse4_2 ssse3" 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="pc" INPUT_DEVICES="evdev" 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-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="intel i965" 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:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 1 xiaojie+bugzillagentoo 2021-08-01 20:17:35 UTC
Created attachment 729525 [details]
android-tools build log
Comment 2 xiaojie+bugzillagentoo 2021-08-01 20:18:06 UTC
Created attachment 729528 [details]
pyside2 build log
Comment 3 xiaojie+bugzillagentoo 2021-08-01 20:19:09 UTC
Failures are pretty deterministic. Tried to compile with emerge -j1 without success.
Comment 4 Rob Burcham 2021-08-05 22:28:09 UTC
Can confirm.  Same android-tools version, same gcc.

/var/tmp/portage/dev-util/android-tools-31.0.0_p1/work/android-tools-31.0.0p1/vendor/libbase/logging.cpp:330:6: internal compiler error: in expand_expr_real_1, at expr.c:10012
Comment 5 Dirk Schneider 2021-08-06 14:08:06 UTC
Same problem here ...
Switching to gcc-10.3.0-r2 worked for me.
Comment 6 xiaojie+bugzillagentoo 2021-08-08 20:10:14 UTC
(In reply to Dirk Schneider from comment #5)
> Same problem here ...
> Switching to gcc-10.3.0-r2 worked for me.

Indeed, same thing here.
Comment 7 Henning Schild 2021-08-28 09:13:02 UTC
ran into that with gcc-9.2.0, switching to 10.3.0 helped
Comment 8 intent 2021-09-29 02:53:46 UTC
Same problem.
When I switch gcc version to 11.2.0, it's work for me. Old gcc version is 9.4.0.
Comment 9 Larry the Git Cow gentoo-dev 2021-10-14 19:55:51 UTC
The bug has been referenced in the following commit(s):

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

commit 60373435af6039609ab613bffa4c3efcd6557689
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2021-10-14 19:55:10 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2021-10-14 19:55:43 +0000

    sys-devel/gcc: add 9.4.1_pre9999
    
    If it happens, it'll probably be 9.5(?), but in any case,
    this is useful for testing out bugs.
    
    Bug: https://bugs.gentoo.org/806094
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-devel/gcc/gcc-9.4.1_pre9999.ebuild | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-15 01:37:21 UTC
Created attachment 744981 [details]
logging.ii

Reproduced here with gcc-9.4.0 and reduced (attached logging.ii).

$ g++ -c logging.ii
during RTL pass: expand
logging.ii: In lambda function:
logging.ii:13:36: internal compiler error: in expand_expr_real_1, at expr.c:10014
   13 |     *file_header.c_str() = snprintf(sizeof(logd_chunk));
      |                            ~~~~~~~~^~~~~~~~~~~~~~~~~~~~
unrecognized DWARF version in .debug_info at 6
unrecognized DWARF version in .debug_info at 6
unrecognized DWARF version in .debug_info at 6
unrecognized DWARF version in .debug_info at 6
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.gentoo.org/> for instructions.
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-15 01:44:08 UTC
(In reply to Sam James from comment #10)
> Created attachment 744981 [details]
> logging.ii
> 
> Reproduced here with gcc-9.4.0 and reduced (attached logging.ii).
> 

Reported upstream: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102757.
Comment 12 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-15 01:53:50 UTC
(In reply to xiaojie+bugzillagentoo from comment #2)
> Created attachment 729528 [details]
> pyside2 build log

The pyside2 bug seems completely different to this. They're both failing as "ninja: subcommand failed" but that's not the _real_ error (just a side-effect). Please file a new bug for that issue if you're still hitting it.
Comment 13 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-11 01:52:40 UTC
GCC 9 is nearly EOL. If you're using this, please upgrade.
Comment 14 xiaojie+bugzillagentoo 2022-05-16 07:12:16 UTC
(In reply to Sam James from comment #13)
> GCC 9 is nearly EOL. If you're using this, please upgrade.

Should I close the bug report, since GCC 9 EOL and GCC 10 solves the problem ?
Comment 15 Mr. Marcelo Teixeira Ruggeri 2022-05-27 13:47:21 UTC
I'm facing exactly same problem on gcc 12,
more specificaly 'x86_64-pc-linux-gnu-12.1.0' ;

I hope you don't tell me gcc-12 is reaching it's End of Life, but anyway. It doesn't build android-tools, only if I revert back to gcc 11.3.0. No patch, no other fix, just "eselect gcc set 4" to the 11th one and done! Built, complete, running
Comment 16 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-05-27 17:12:10 UTC
(In reply to Mr. Marcelo Teixeira Ruggeri from comment #15)
> I'm facing exactly same problem on gcc 12,
> more specificaly 'x86_64-pc-linux-gnu-12.1.0' ;
> 
> I hope you don't tell me gcc-12 is reaching it's End of Life, but anyway. It
> doesn't build android-tools, only if I revert back to gcc 11.3.0. No patch,
> no other fix, just "eselect gcc set 4" to the 11th one and done! Built,
> complete, running

Please file a new bug for this and we'll debug it together. Include the full build.log and emerge --info.