Summary: | sys-devel/gcc: ICE (internal compiler error) with gcc-11 when building kde-plasma/kwin (LTO with older archives) | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Johannes Hirte <johannes.hirte> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED UPSTREAM | ||
Severity: | normal | CC: | ffsoras, herb, sam |
Priority: | Normal | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 618550 |
Description
Johannes Hirte
2021-08-10 17:44:23 UTC
minimized test case minimized.cpp: class QObject; class QUiLoader { public: QUiLoader(QObject * = nullptr); }; void GenericScriptedConfigcreateUi() { QUiLoader loader; } leads to: /usr/bin/x86_64-pc-linux-gnu-g++ -fPIC -O2 -flto=8 -fuse-linker-plugin -march=znver1 -mtune=znver1 --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=512 -ftree-vectorize -fvect-cost-model -fno-operator-names -fno-exceptions -Wall -Wextra -Wcast-align -Wchar-subscripts -Wformat-security -Wno-long-long -Wpointer-arith -Wundef -Wnon-virtual-dtor -Woverloaded-virtual -Werror=return-type -Wvla -Wdate-time -Wsuggest-override -Wlogical-op -fdiagnostics-color=always -Wl,--no-undefined -Wl,--enable-new-dtags -Wl,-O1 -Wl,--as-needed -shared -o minimized.so minimized.cpp /usr/lib64/libKF5ConfigWidgets.so.5.84.0 /usr/lib64/libKF5Service.so.5.84.0 /usr/lib64/libKF5Codecs.so.5.84.0 /usr/lib64/libKF5WidgetsAddons.so.5.84.0 /usr/lib64/libKF5ConfigGui.so.5.84.0 /usr/lib64/libKF5Auth.so.5.84.0 /usr/lib64/libKF5AuthCore.so.5.84.0 /usr/lib64/libKF5I18n.so.5.84.0 /usr/lib64/libKF5ConfigCore.so.5.84.0 /usr/lib64/libKF5CoreAddons.so.5.84.0 /usr/lib64/libQt5Xml.so.5.15.2 /usr/lib64/libQt5DBus.so.5.15.2 /usr/lib64/libQt5UiTools.a /usr/lib64/libQt5Widgets.so.5.15.2 /usr/lib64/libQt5Gui.so.5.15.2 /usr/lib64/libQt5Core.so.5.15.2 /usr/lib64//libQt5Widgets.so /usr/lib64//libQt5Gui.so /usr/lib64//libQt5Core.so /usr/lib64//libQt5Widgets.so /usr/lib64//libQt5Gui.so /usr/lib64//libQt5Core.so -lpthread /usr/lib64/libGL.so /var/tmp/portage/dev-qt/designer-5.15.2/work/qttools-everywhere-src-5.15.2/src/designer/src/uitools/quiloader.h:68:7: warning: type ‘struct QUiLoader’ violates the C++ One Definition Rule [-Wodr] genericscriptedconfig.cpp.ii:2:7: note: a type with different bases is defined in another translation unit 2 | class QUiLoader { | ^ lto1: internal compiler error: Segmentation fault 0xd5cd5b internal_error(char const*, ...) ???:0 0xe64bbe bp_unpack_string(data_in*, bitpack_d*) ???:0 0x12d8cdd cl_optimization_stream_in(data_in*, bitpack_d*, cl_optimization*) ???:0 0xe61c32 streamer_read_tree_bitfields(lto_input_block*, data_in*, tree_node*) ???:0 0xe5e5d4 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) ???:0 0xe5f642 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*, bool) ???:0 0xe56a63 read_cgraph_and_symbols(unsigned int, char const**) ???:0 0x12d6256 lto_main() ???:0 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. lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status reduced compiler flags: /usr/bin/x86_64-pc-linux-gnu-g++ -fPIC -flto=8 -fuse-linker-plugin -shared -o minimized.so minimized.cpp /usr/lib64/libKF5ConfigWidgets.so.5.84.0 /usr/lib64/libKF5Service.so.5.84.0 /usr/lib64/libKF5Codecs.so.5.84.0 /usr/lib64/libKF5WidgetsAddons.so.5.84.0 /usr/lib64/libKF5ConfigGui.so.5.84.0 /usr/lib64/libKF5Auth.so.5.84.0 /usr/lib64/libKF5AuthCore.so.5.84.0 /usr/lib64/libKF5I18n.so.5.84.0 /usr/lib64/libKF5ConfigCore.so.5.84.0 /usr/lib64/libKF5CoreAddons.so.5.84.0 /usr/lib64/libQt5Xml.so.5.15.2 /usr/lib64/libQt5DBus.so.5.15.2 /usr/lib64/libQt5UiTools.a /usr/lib64/libQt5Widgets.so.5.15.2 /usr/lib64/libQt5Gui.so.5.15.2 /usr/lib64/libQt5Core.so.5.15.2 /usr/lib64//libQt5Widgets.so /usr/lib64//libQt5Gui.so /usr/lib64//libQt5Core.so /usr/lib64//libQt5Widgets.so /usr/lib64//libQt5Gui.so /usr/lib64//libQt5Core.so -lpthread /usr/lib64/libGL.so/var/tmp/portage/dev-qt/designer-5.15.2/work/qttools-everywhere-src-5.15.2/src/designer/src/uitools/quiloader.h:68:7: warning: type ‘struct QUiLoader’ violates the C++ One Definition Rule [-Wodr] minimized.cpp:2:7: note: a type with different bases is defined in another translation unit 2 | class QUiLoader { | ^ lto1: internal compiler error: Segmentation fault 0xd5cd5b internal_error(char const*, ...) ???:0 0xe64bbe bp_unpack_string(data_in*, bitpack_d*) ???:0 0x12d8cdd cl_optimization_stream_in(data_in*, bitpack_d*, cl_optimization*) ???:0 0xe61c32 streamer_read_tree_bitfields(lto_input_block*, data_in*, tree_node*) ???:0 0xe5e5d4 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) ???:0 0xe5f642 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*, bool) ???:0 0xe56a63 read_cgraph_and_symbols(unsigned int, char const**) ???:0 0x12d6256 lto_main() ???:0 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. lto-wrapper: fatal error: /usr/bin/x86_64-pc-linux-gnu-g++ returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status Most minimized example /usr/bin/x86_64-pc-linux-gnu-g++ -o minimized.so minimized.cpp /usr/lib64/libQt5UiTools.a /usr/lib64/libQt5UiTools.a belongs to dev-qt/designer-5.15.2. I've already rebuild this and it didn't changed anything. Another rebuild seems at least to fix the minimal example. Okay, with the second re-emerge of dev-qt/designer, build of kde-plasma/kwin did without problem. Don't know what's the different now, but the ICE is gone. I think there is still a bug in gcc. At least it's not robust for bad input. Sadly I can't debug this any further. Giving this to toolchain in case they want to investigate. > -flto=8 This bug is a SIGSEGV in gcc's LTO streamer that reading existing GIMPLE: lto1: internal compiler error: Segmentation fault 0xd5cd5b internal_error(char const*, ...) 0xe64bbe bp_unpack_string(data_in*, bitpack_d*) 0x12d8cdd cl_optimization_stream_in(data_in*, bitpack_d*, cl_optimization*) 0xe61c32 streamer_read_tree_bitfields(lto_input_block*, data_in*, tree_node*) 0xe5e5d4 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int) 0xe5f642 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned int*, bool) 0xe56a63 read_cgraph_and_symbols(unsigned int, char const**) 0x12d6256 lto_main() LTO has a lot stricter constraints on how cross-version is checked (compared to .o files with object code). The check is in https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/lto-streamer.c;h=84db5eb944d80eb0c811e2eafc7732c7d8a17880;hb=HEAD#l259 Note that LTO_major / LTO_minor used to be maintained separately. Sometimes bumps were missed. Recent fix for gcc-12+ should get version skew sorted at least between major versions: https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=e3a682f4197f9f39808febfd1862e722d7675d34 -#define LTO_major_version 9 +#define LTO_major_version GCC_major_version #define LTO_minor_version 0 Older gccs are still affected. SIGSEGV also means that bytecode validation is incomplete. The bug is also triggered by using .a files from packages built at a different time. You would probably need to mitigate it somehow on your system: you need to rebuild them every time compiler changes enough. And I wonder if use of .a files could be avoided across packages. *** Bug 809836 has been marked as a duplicate of this bug. *** *** Bug 808905 has been marked as a duplicate of this bug. *** |