Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662208 - dev-lang/python-3.6.5 emerge fails: gcc 7.3.0 "internal compiler error: Segmentation fault"
Summary: dev-lang/python-3.6.5 emerge fails: gcc 7.3.0 "internal compiler error: Segme...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://gcc.gnu.org/PR83317
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-07-26 20:38 UTC by Andrea Zuccherelli
Modified: 2019-03-02 09:02 UTC (History)
2 users (show)

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


Attachments
Output of "emerge -1v =dev-lang/python-3.6.5" (emerge_python_36_fail.log,173.84 KB, application/octet-stream)
2018-07-26 20:38 UTC, Andrea Zuccherelli
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Andrea Zuccherelli 2018-07-26 20:38:04 UTC
Created attachment 541160 [details]
Output of "emerge -1v =dev-lang/python-3.6.5"

Good evening, I have a problem here: my 7.3.0 gcc segfaults.
Running "emerge -1v =dev-lang/python-3.6.5" fails.

I have tried to recompile my gcc... No way, same error.
My next attempt will be to try back with gcc 6.4.0.

Can anyone help, please?

Attached is the emerge log and this is my "emerge --info" output:

Portage 2.3.40 (python 3.5.5-final-0, hardened/linux/x86, gcc-7.3.0, glibc-2.26-r7, 4.9.87-zlive5 i686)
=================================================================
System uname: Linux-4.9.87-zlive5-i686-Intel-R-_Core-TM-_i7-3632QM_CPU_@_2.20GHz-with-gentoo-2.4.1
KiB Mem:     1029864 total,    183844 free
KiB Swap:    1048572 total,   1046916 free
Timestamp of repository gentoo: Wed, 25 Jul 2018 19:15:01 +0000
Head commit of repository gentoo: 63fd0be576f822c65c0800bd7eb485266cf40b38
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p2) 2.30.0
ccache version 3.3.4 [enabled]
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3-r1::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.5::gentoo
dev-util/ccache:          3.3.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.13::gentoo
sys-devel/autoconf:       2.69-r4::gentoo
sys-devel/automake:       1.15.1-r2::gentoo
sys-devel/binutils:       2.30-r2::gentoo
sys-devel/gcc:            7.3.0-r3::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r7::gentoo
Repositories:

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

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

ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-march=prescott -mfpmath=sse -O2 -pipe -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/bind"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=prescott -mfpmath=sse -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY 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="-march=i686 -O2 -pipe"
FEATURES="assume-digests binpkg-logs buildpkg ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=i686 -O2 -pipe"
GENTOO_MIRRORS="ftp://gentoo.imj.fr/pub/gentoo/ http://mirror.leaseweb.com/gentoo/ http://gentoo.mirror.dkm.cz/pub/gentoo/ ftp://mirror.bytemark.co.uk/gentoo/ http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j1"
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 berkdb bzip2 caps cli crypt cxx dri gdbm gpm hardened iconv idn iproute2 ipv6 libtirpc mmx modules ncurses nls nptl openmp pam pcre pic pie readline seccomp snmp sse sse2 ssl ssp tcpd threads tty-helpers unicode urandom x86 xattr xtpax zlib" ABI_X86="32" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 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 plan sheets stage words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="sse sse2 mmx" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock 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="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby22 ruby23" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Andrea Zuccherelli 2018-07-26 21:15:15 UTC
Revert back to gcc-6.4.0: no failure
Comment 2 Alix 2018-07-27 16:11:02 UTC
python-3.6.5 & gcc-7.3.0, got the same build error.
Comment 3 Alix 2018-07-27 16:20:11 UTC
error doesn't seem to be hardened-specific: it's reproducible on my other system with default/linux/x86/17.0 (stable) profile.
Comment 4 Alix 2018-07-27 17:54:26 UTC
builds fine on a x86_64 system, so this is specific to x86 arch...
Comment 5 Alix 2018-07-29 09:42:40 UTC
https://bugs.gentoo.org/658688
Comment 6 Alix 2018-07-29 09:59:46 UTC
the bug I referenced above might be related, but I've never had a gcc pgo flag enabled on any of my x86 systems that are having the problem.
Comment 7 Alix 2018-07-29 11:26:40 UTC
so, the problem in my case is in the -mfpmath=sse along with -msse2 and -mssse3 CFLAGS. removing -msse2 and -mssse3 stops gcc 7.3.0 from segfaulting in cmathmodule.c. -march is set to i686.

Andrea Zuccherelli, replace march=prescott with march=i686 in your CFLAGS; should help. (why do you have a prescott march set on an ivy bridge cpu anyway?)
Comment 8 Andrea Zuccherelli 2018-07-29 20:55:42 UTC
Hi Alix. Thank you for your analysis: GCC is infact failing in 'cmath_acos' and for that is probably using SSE optimizations.

For the "prescott" architecture: I am running Gentoo in a template Virtualbox VM (so the i7 3632QM is the real CPU where the VM is running on). I have two old ITX boards based on Atom N270 (my router and my NAS). From time to time when the template is stable and bug fixed I convert it to run as a live overlay and then transfer the image to the device CF. I used "prescott" because in 2010 Gentoo suggested that CFLAGS for ATOM N270. That wiki is no more available online, so I report the link to Internet Archive:
https://web.archive.org/web/20100629050418/http://en.gentoo-wiki.com/wiki/Safe_Cflags/Intel#Atom_230

For now I will revert back to GCC 6.4.0, hoping and waiting for a solution of this bug in the GCC 7 line.
Comment 9 Alix 2018-07-30 07:43:55 UTC
looks like it should be fixed in gcc 7.4:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83317
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2019-02-15 07:59:07 UTC
Please check if gcc-8 works for you.
Comment 11 Alix 2019-03-02 06:19:03 UTC
no errors with python-3.6.5 on gcc-8.2.0 (x86 system)
Comment 12 Sergei Trofimovich (RETIRED) gentoo-dev 2019-03-02 09:02:34 UTC
Thank you for the test! Closing as RESOLVED.