Summary: | gcc-10.1.0 SIGSEGVs in has_undead_caller_from_outside_scc_p() (was: dev-util/radare2-4.5.0 with -flto leads to lto1 segfault) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Gabriel Marcano <gabemarcano> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | davidroman96, gabemarcano, sam, slyfox, stefantalpalaru |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Attachments: |
radare2 build segfault build.log
0001-ipa-96291-don-t-crash-on-unoptimized-lto-functions.patch |
Description
Gabriel Marcano
2020-07-22 07:37:48 UTC
Created attachment 650160 [details]
radare2 build segfault build.log
Here is the build log showing the segmentation fault.
Reproduced locally. Fails for both gcc-10.1.0 and gcc-11.0.0. Looking. Bit of gcc backtrace: """ x86_64-pc-linux-gnu-gcc -march=ivybridge -pipe -fomit-frame-pointer -O2 -flto -frecord-gcc-switches -march=ivybridge -pipe -fomit-frame-pointer -O2 -flto -frecord-gcc-switches -march=ivybridge -pipe -fomit-frame-pointer -O2 -flto -frecord-gcc-switches -MD -fPIC -g -Wall -D__UNIX__=1 -march=ivybridge -pipe -fomit-frame-pointer -O2 -flto -frecord-gcc-switches -MD -fPIC -g -Wall -D__UNIX__=1 -DR2_PLUGIN_INCORE -I/tmp/portage/dev-util/radare2-4.5.0/work/radare2-4.5.0/libr/..//shlr -I/tmp/portage/dev-util/radare2-4.5.0/work/radare2-4.5.0/libr/../shlr/zip/include -I/tmp/portage/dev-util/radare2-4.5.0/work/radare2-4.5.0/libr -I/tmp/portage/dev-util/radare2-4.5.0/work/radare2-4.5.0/libr/include -fvisibility=hidden -I../../shlr/sdb/src//src -DHAVE_FORK=1 -DUSE_R2=1 -I../../shlr -std=gnu99 -D_XOPEN_SOURCE=700 -D_POSIX_C_SOURCE=200809L -Wall -Wsign-compare -g -Wall -O0 -MMD -fPIC -g -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -Wl,-O1 -Wl,--as-needed -Wl,--defsym=__gentoo_check_ldflags__=0 -lm -lssl -lcrypto -lpthread -ldl -lm -fvisibility=hidden -o sdb main.o cdb.o buffer.o cdb_make.o ls.o sdbht.o ht_uu.o sdb.o num.o base64.o match.o json.o ns.o lock.o util.o disk.o query.o array.o fmt.o journal.o dict.o ht_pp.o ht_up.o set.o diff.o during IPA pass: cp lto1: internal compiler error: Segmentation fault 0xa6d3df crash_signal /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/toplev.c:328 0x7f01be86bc3f ??? /usr/src/debug/sys-libs/glibc-2.31-r6/glibc-2.31/signal/../sysdeps/unix/sysv/linux/x86_64/sigaction.c:0 0x5d4751 has_undead_caller_from_outside_scc_p /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/ipa-cp.c:5670 0x680054 cgraph_node::call_for_symbol_thunks_and_aliases(bool (*)(cgraph_node*, void*), void*, bool, bool) /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/cgraph.c:2450 0x12fe86d identify_dead_nodes /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/ipa-cp.c:5687 0x12fe86d ipcp_decision_stage /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/ipa-cp.c:5730 0x12fe86d ipcp_driver /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/ipa-cp.c:5908 0x12fe86d execute /usr/src/debug/sys-devel/gcc-11.0.0_pre9999/gcc-11.0.0_pre9999/gcc/ipa-cp.c:5999 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://bugs.gentoo.org/> for instructions. """ Reported upstream as https://gcc.gnu.org/PR96291 Created attachment 650756 [details, diff]
0001-ipa-96291-don-t-crash-on-unoptimized-lto-functions.patch
If you are feeling adventurous you can test 0001-ipa-96291-don-t-crash-on-unoptimized-lto-functions.patch gcc patch.
You will need to add it to /etc/portage/patches/sys-devel/gcc:10/ and rebuild gcc.
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=8f9b6cda0cd772b5155d52a5effabd04fd656a18 commit 8f9b6cda0cd772b5155d52a5effabd04fd656a18 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-07-26 10:34:45 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-07-26 10:34:45 +0000 10.2.0: fix IPA ICE on LTO -O0/-O2 mix Bug: https://bugs.gentoo.org/733482 Bug: https://gcc.gnu.org/PR96291 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> .../gentoo/33_all_lto-O0-mix-ICE-ipa-PR96291.patch | 46 ++++++++++++++++++++++ 10.2.0/gentoo/README.history | 3 ++ 2 files changed, 49 insertions(+) Queued patch for next gcc patchset. It usually takes about a month to get into next revbump of gcc in gentoo. I have a similar ICE when compiling another package, and it's not solved by the proposed patch: x86_64-pc-linux-gnu-gcc -pthread -fPIC -fno-strict-aliasing -O3 -march=native -mlwp -pipe -fwrapv -DNDEBUG -fprofile-generate -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -I. -I/var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Include -I/var/tmp/portage/dev-lang/tauthon -2.8.2/work/x86_64-pc-linux-gnu -c /var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/parsermodule.c -o build/temp.linux-x86_64-2.8/var /tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/parsermodule.o [...] x86_64-pc-linux-gnu-gcc -pthread -fPIC -fno-strict-aliasing -O3 -march=native -mlwp -pipe -fwrapv -DNDEBUG -fprofile-use -fprofile-correction -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -g -I. -I/var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Include -I/var/tmp/portage/dev-lang/tauthon-2.8.2/work/x86_64-pc-linux-gnu -c /var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/parsermodule.c -o build/temp.linux-x86_64-2.8/var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/parsermodule.o during IPA pass: inline /var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/parsermodule.c:3760:1: internal compiler error: in add_new_edges_to_heap, at ipa-inline.c:1746 3760 | } | ^ (In reply to Ștefan Talpalaru from comment #8) > I have a similar ICE when compiling another package, and it's not solved by > the proposed patch: > > x86_64-pc-linux-gnu-gcc -pthread -fPIC -fno-strict-aliasing -O3 > -march=native -mlwp -pipe -fwrapv -DNDEBUG -fprofile-generate -flto > -fuse-linker-plugin > -ffat-lto-objects -flto-partition=none -g -I. > -I/var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Include > -I/var/tmp/portage/dev-lang/tauthon > -2.8.2/work/x86_64-pc-linux-gnu -c > /var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/ > parsermodule.c -o build/temp.linux-x86_64-2.8/var > /tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/parsermodule.o > > [...] > > x86_64-pc-linux-gnu-gcc -pthread -fPIC -fno-strict-aliasing -O3 > -march=native -mlwp -pipe -fwrapv -DNDEBUG -fprofile-use > -fprofile-correction -flto -fuse-linker-plugin -ffat-lto-objects > -flto-partition=none -g -I. > -I/var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Include > -I/var/tmp/portage/dev-lang/tauthon-2.8.2/work/x86_64-pc-linux-gnu -c > /var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/ > parsermodule.c -o > build/temp.linux-x86_64-2.8/var/tmp/portage/dev-lang/tauthon-2.8.2/work/ > tauthon-2.8.2/Modules/parsermodule.o > during IPA pass: inline > /var/tmp/portage/dev-lang/tauthon-2.8.2/work/tauthon-2.8.2/Modules/ > parsermodule.c:3760:1: internal compiler error: in add_new_edges_to_heap, at > ipa-inline.c:1746 > 3760 | } > | ^ This is probably a similar but distinct bug in ipa-inline (opposed to SIGSEGV in ipa constrant propagation in this bug). I suggest sorting it out in a new bug. Can you file one with a link to the ebuild? I'll try to reproduce locally. The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=9bba1f72a9210743fddf664b716b5cf288132922 commit 9bba1f72a9210743fddf664b716b5cf288132922 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-08-23 09:11:31 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-08-23 09:11:31 +0000 10.2.0: cut 2 patchset Four new patches: + 33_all_lto-O0-mix-ICE-ipa-PR96291.patch: fix -O0 crash for ipa/lto + 34_all_fundecl-ICE-PR95820.patch: fix ICE on invalid templates + 35_all_ipa-fix-bit-CP.patch: fix bad code generation in ipa bit constprop + 36_all_ipa-fix-bit-CP-p2.patch: part 2 of previous patch Bug: https://bugs.gentoo.org/733482 Bug: https://gcc.gnu.org/PR96291 Bug: https://bugs.gentoo.org/730406 Bug: https://gcc.gnu.org/PR95820 Bug: https://bugs.gentoo.org/736685 Bug: https://gcc.gnu.org/PR96482 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> 10.2.0/gentoo/README.history | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=653d6bf6ea15bdf2db033e3099913bac47f5b0e0 commit 653d6bf6ea15bdf2db033e3099913bac47f5b0e0 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2020-08-23 09:17:12 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2020-08-23 09:17:12 +0000 sys-devel/gcc: cut 2 patchset Four new patches: + 33_all_lto-O0-mix-ICE-ipa-PR96291.patch: fix -O0 crash for ipa/lto + 34_all_fundecl-ICE-PR95820.patch: fix ICE on invalid templates + 35_all_ipa-fix-bit-CP.patch: fix bad code generation in ipa bit constprop + 36_all_ipa-fix-bit-CP-p2.patch: part 2 of previous patch Closes: https://bugs.gentoo.org/733482 Bug: https://gcc.gnu.org/PR96291 Closes: https://bugs.gentoo.org/730406 Bug: https://gcc.gnu.org/PR95820 Closes: https://bugs.gentoo.org/736685 Bug: https://gcc.gnu.org/PR96482 Package-Manager: Portage-3.0.4, Repoman-3.0.1 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> sys-devel/gcc/Manifest | 1 + sys-devel/gcc/gcc-10.2.0-r1.ebuild | 13 +++++++++++++ 2 files changed, 14 insertions(+) |