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

Bug 618320

Summary: sys-devel/gcc-5.4.0 segfault on x11-libs/wxGTK-3.0.2.0-r2 with -march=amdfam10
Product: Gentoo Linux Reporter: Anthoine Bourgeois <anthoine.bourgeois>
Component: HardenedAssignee: The Gentoo Linux Hardened Team <hardened>
Status: RESOLVED INVALID    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info '=x11-libs/wxGTK-3.0.2.0-r2::gentoo'
emerge -pqv '=x11-libs/wxGTK-3.0.2.0-r2::gentoo'
The ebuild environment file
build

Description Anthoine Bourgeois 2017-05-12 22:46:29 UTC
I switch to gcc-5.4.0 recently. I read the news "2015-10-22-gcc-5-new-c++11-abi" and run the command "revdep-rebuild --library 'libstdc++.so.6' -- --exclude gcc" as describe in the news. The revdep-rebuild command rebuild x11-libs/wxGTK-3.0.2.0-r2.

The wxGTK package doesn't build because of a segfault of gcc:
x86_64-pc-linux-gnu-g++: internal compiler error: Segmentation fault (program cc1plus)

I go to the build directory "/var/tmp/portage/x11-libs/wxGTK-3.0.2.0-r2/work/wxPython-src-3.0.2.0-abi_x86_64.amd64" and copy the gcc command that segfault and I reproduce the problem.

If I suppress the "-march=amdfam10" option, the build is fine. If I stay with the march option and switch to the vanilla gcc, the build is OK too.
Comment 1 Anthoine Bourgeois 2017-05-12 22:47:32 UTC
Created attachment 472446 [details]
emerge --info '=x11-libs/wxGTK-3.0.2.0-r2::gentoo'
Comment 2 Anthoine Bourgeois 2017-05-12 22:47:54 UTC
Created attachment 472448 [details]
emerge -pqv '=x11-libs/wxGTK-3.0.2.0-r2::gentoo'
Comment 3 Anthoine Bourgeois 2017-05-12 22:52:38 UTC
Created attachment 472450 [details]
The ebuild environment file
Comment 4 Anthoine Bourgeois 2017-05-12 22:57:19 UTC
Created attachment 472452 [details]
build
Comment 5 Anthoine Bourgeois 2017-06-21 20:58:52 UTC
If I set "echo 1 > /proc/sys/kernel/pax/softmode" the gcc doesn't segfault.

So it's a gcc with hardened profile, pax enabled and march=amdfam10 issue, quite a corner case :-)
Comment 6 Anthoine Bourgeois 2017-07-03 22:25:05 UTC
paxctl -r /usr/libexec/gcc/x86_64-pc-linux-gnu/5.4.0/cc1plus fixes the problem. Is it a PAX or GCC problem ?
Comment 7 Magnus Granberg gentoo-dev 2017-07-31 12:13:56 UTC
(In reply to Anthoine Bourgeois from comment #6)
> paxctl -r /usr/libexec/gcc/x86_64-pc-linux-gnu/5.4.0/cc1plus fixes the
> problem. Is it a PAX or GCC problem ?

Your kernel config and the Gcc ebuild should allready set the needed pax marks on the bin.
Comment 8 Anthoine Bourgeois 2017-08-06 19:22:57 UTC
(In reply to Magnus Granberg from comment #7)
> (In reply to Anthoine Bourgeois from comment #6)
> > paxctl -r /usr/libexec/gcc/x86_64-pc-linux-gnu/5.4.0/cc1plus fixes the
> > problem. Is it a PAX or GCC problem ?
> 
> Your kernel config and the Gcc ebuild should allready set the needed pax
> marks on the bin.

Your right my kernel config didn't set the CONFIG_PAX_XATTR_PAX_FLAGS=y and the PAX flags are only set in XATTR now.