Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 704716 - sys-devel/gcc-9.2.0-r2 internal compiler error on x11-libs/wxGTK/3.0.4-r302 (pax aslr)
Summary: sys-devel/gcc-9.2.0-r2 internal compiler error on x11-libs/wxGTK/3.0.4-r302 (...
Status: RESOLVED OBSOLETE
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-01-03 17:06 UTC by Fedja Beader
Modified: 2023-04-20 22:50 UTC (History)
3 users (show)

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


Attachments
Terminal log (build log + some more command-line action) (ICE.log,431.15 KB, text/plain)
2020-01-03 17:07 UTC, Fedja Beader
Details
Broad set of logs (working and failed merges) (logs_wxGTK-3.0.4-r302.tar.xz,89.88 KB, application/x-xz)
2020-05-18 08:06 UTC, Edgar Dragon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fedja Beader 2020-01-03 17:06:38 UTC
x86_64-pc-linux-gnu-g++ -c -o basedll_any.o -I./.pch/wxprec_basedll -D__WXGTK__      -DWXBUILDING      -I/tmp/portage/x11-libs/wxGTK-3.0.4-r302/work/wxWidgets-3.0.4/src/regex  -DwxUSE_GUI=0 -DWXMAKINGDLL_BASE -DwxUSE_BASE=1 -fPIC -DPIC -Wall -Wundef -Wunused-parameter -Wno-ctor-dtor-privacy -Woverloaded-virtual -D_FILE_OFFSET_BITS=64 -I/tmp/portage/x11-libs/wxGTK-3.0.4-r302/work/wxWidgets-3.0.4-abi_x86_64.amd64/lib/wx/include/gtk3-unicode-3.0-gtk3 -I/tmp/portage/x11-libs/wxGTK-3.0.4-r302/work/wxWidgets-3.0.4/include -pthread -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/lib64/libffi-3.3_rc0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gstreamer-1.0 -I/usr/lib64/libffi-3.3_rc0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -DWX_PRECOMP -pthread -pthread -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/lib64/libffi-3.3_rc0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -pthread -I/usr/include/gtk-3.0/unix-print -I/usr/include/gtk-3.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/gtk-3.0 -I/usr/include/gio-unix-2.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/fribidi -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/uuid -I/usr/lib64/libffi-3.3_rc0/include -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -D_REENTRANT -I/usr/include/SDL2 -O2 -pipe -fomit-frame-pointer -march=core2 -fvisibility=hidden -fvisibility-inlines-hidden /tmp/portage/x11-libs/wxGTK-3.0.4-r302/work/wxWidgets-3.0.4/src/common/any.cpp

x86_64-pc-linux-gnu-g++: internal compiler error: Segmentation fault signal terminated program cc1plus


-save-temps produces an empty file any.ii.

Manually continuing the build with "make" results in all subsequent input files also failing with ICE. See attached log for build log + some command-line action.


This package otherwise builds fine with gcc-8.3.0-r1.

Reproducible: Always
Comment 1 Fedja Beader 2020-01-03 17:07:40 UTC
Created attachment 602422 [details]
Terminal log (build log + some more command-line action)
Comment 2 Jonas Stein gentoo-dev 2020-01-03 19:10:50 UTC
Thank you for the report. Please paste the emerge info as described on
https://wiki.gentoo.org/wiki/Attach_the_logs_to_the_bug_ticket
We need to have all information at hand before ticket assignment, so that the maintainer can look after it in one session with minimal number of callbacks.
Please reopen this ticket (Status:unconfirmed) afterwards.
Comment 3 Sergei Trofimovich (RETIRED) gentoo-dev 2020-01-03 23:31:49 UTC
Zorry pointed out on #gentoo-toolchain that it's a PCH-related failure: https://bugs.gentoo.org/301299

We have a few things here:
- x11-libs/wxGTK unconditionally uses PCH headers (easy to disable with configure option).
- gcc's PCH loading code does not detect the fact that PCH headers are loaded by pax kernel at unexpected location.

In this bug I'll poke at gcc to check if we can fix it's mmap() error handling.
Comment 4 Fedja Beader 2020-01-03 23:43:00 UTC
For everyone else, this makes the build succeed:

diff /var/portage/tree/x11-libs/wxGTK/wxGTK-3.0.4-r302.ebuild /var/portage/local/x11-libs/wxGTK/wxGTK-3.0.4-r302.ebuild
--- /var/portage/tree/x11-libs/wxGTK/wxGTK-3.0.4-r302.ebuild    2019-10-11 18:11:20.000000000 +0200
+++ /var/portage/local/x11-libs/wxGTK/wxGTK-3.0.4-r302.ebuild   2020-01-03 22:45:22.653003797 +0100
@@ -100,6 +100,7 @@
                        --with-zlib=sys
                        --with-expat=sys
                        --enable-compat28
+                       --disable-precomp-headers
                        $(use_with sdl)"
 
        # debug in >=2.9


or perhaps also
EXTRA_ECONF=--disable-precomp-headers emerge ... wxGTK...
Comment 5 Edgar Dragon 2020-05-18 08:06:37 UTC
Created attachment 640028 [details]
Broad set of logs (working and failed merges)

Thx, applying `EXTRA_ECONF=--disable-precomp-headers` resolved my compile issues, even though my output is not segfault, but different. The bizarre thing is, I removed the EXTRA_ECONF, and it compiled again right after without a hitch. I unmerged it, and reemerged it. Still can't reproduce anymore. 

So I did a @world:

> Cloud / # emerge -avuDN --quiet-fail=y --with-bdeps=y --keep-going @world
> These are the packages that would be merged, in order:
> Calculating dependencies                        ... done!
> [ebuild   R    ] dev-libs/libpcre-8.43:3::gentoo  USE="bzip2 cxx jit pcre16* pcre32* readline recursion-limit (split-usr) (unicode) zlib -libedit -static-libs" ABI_X86="(64) -32 (-x32)" 0 KiB
> [ebuild     U  ] app-crypt/gnupg-2.2.20::gentoo [2.2.19::gentoo] USE="bzip2 ldap nls readline smartcard ssl usb -doc (-selinux) -tofu -tools -user-socket -wks-server" 6,628 KiB

And afterwards attempt installing a package:

> Cloud / # emerge -av -j32 --quiet-fail=y kicad
> These are the packages that would be merged, in order:
> Calculating dependencies        ... done!
> [ebuild  N     ] x11-libs/wxGTK-3.0.4-r302:3.0-gtk3::gentoo  USE="X debug gstreamer libnotify opengl sdl tiff (-aqua) -doc -webkit" ABI_X86="(64) -32 (-x32)" 0 KiB
> [ebuild  N    ~] dev-python/wxpython-4.0.7:4.0::gentoo  USE="-test -webkit" PYTHON_TARGETS="python3_7 -python3_6 -python3_8" 0 KiB
> [ebuild  N    ~] sci-electronics/kicad-5.1.5-r2::gentoo  USE="doc examples github ngspice oce openmp python -occ" PYTHON_SINGLE_TARGET="python3_7 -python3_6" 0 KiB

And the issue resurfaced!:

> /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: > /usr/lib/debug/usr/lib64/Scrt1.o.debug: no group info for section '.debug_macro'
> /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/Scrt1.o: in function `_start':
> (.text+0x20): undefined reference to `main'
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:15909: .pch/wxprec_xrcdll/wx/wxprec.h.gch] Error 1

Note that I've attempted debug removal beforehand via `*FLAGS-=-ggdb3` and `USE=-debug`, where same errors persisted, maybe due rest of the system being built that way. But disabling PCH solved this.

On the other hand, different system exhibiting issues:

> /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: > /usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../lib64/Scrt1.o: in function `_start':
> /usr/src/debug/sys-libs/glibc-2.30-r8/glibc-2.30/csu/../sysdeps/x86_64/start.S:104: undefined reference to `main'
> collect2: error: ld returned 1 exit status
> make: *** [Makefile:15576: .pch/wxprec_basedll/wx/wxprec.h.gch] Error 1

Did not resolve it (neither disabling PCH nor LDFLAGS -Wl,-O1), but I don't intend to dig into it. As I'm replacing that system.
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-04-20 22:50:08 UTC
We don't have access to PaX anymore I'm afraid, but I advise avoiding PCH even on non-PaX systems given how brittle PCH is.