Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 640014 - sys-libs/db-6.0.35 with sys-devel/gcc-7.2.0 with graphite and lto - .../work/db-6.0.35/src/dbreg/dbreg_util.c:27:1: internal compiler error: Segmentation fault
Summary: sys-libs/db-6.0.35 with sys-devel/gcc-7.2.0 with graphite and lto - .../work/...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-06 12:02 UTC by Amit Prakash Ambasta
Modified: 2021-01-20 08:44 UTC (History)
1 user (show)

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


Attachments
I've isolated the command that fails and added verbosity for detail in the attachment (offending_compile,58.82 KB, text/plain)
2017-12-06 12:02 UTC, Amit Prakash Ambasta
Details
build.log (build.log,376.92 KB, text/x-log)
2017-12-06 12:24 UTC, Amit Prakash Ambasta
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Amit Prakash Ambasta 2017-12-06 12:02:00 UTC
Created attachment 508464 [details]
I've isolated the command that fails and added verbosity for detail in the attachment

Since the profile upgrade to 17.0, lots of packages fail on graphite + lto (which had compiled successfully before).. One such package is sys-libs/db
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2017-12-06 12:16:46 UTC
Please attach the entire build log to this bug report.
Please post your `emerge --info` output in a comment.
Comment 2 Amit Prakash Ambasta 2017-12-06 12:19:53 UTC
 Your comment was:

    I've isolated the segfault to this function in src/dbreg/dbreg_util.c

    /*
     * __dbreg_add_dbentry --
     *  Adds a DB entry to the dbreg DB entry table.
     *
     * PUBLIC: int __dbreg_add_dbentry __P((ENV *, DB_LOG *, DB *, int32_t));
     */
    int
    __dbreg_add_dbentry(env, dblp, dbp, ndx)
        ENV *env;
        DB_LOG *dblp;
        DB *dbp;
        int32_t ndx;
    {
        int32_t i;
        int ret;

        ret = 0;

        MUTEX_LOCK(env, dblp->mtx_dbreg);

        /*
         * Check if we need to grow the table.  Note, ndx is 0-based (the
         * index into the DB entry table) an dbentry_cnt is 1-based, the
         * number of available slots.
         */
        if (dblp->dbentry_cnt <= ndx) {
            if ((ret = __os_realloc(env,
                (size_t)(ndx + DB_GROW_SIZE) * sizeof(DB_ENTRY),
                &dblp->dbentry)) != 0)
                goto err;

            /* Initialize the new entries. */
            for (i = dblp->dbentry_cnt; i < ndx + DB_GROW_SIZE; i++) {
                dblp->dbentry[i].dbp = NULL;
                dblp->dbentry[i].deleted = 0;
            }
            dblp->dbentry_cnt = i;
        }

        DB_ASSERT(env, dblp->dbentry[ndx].dbp == NULL);
        dblp->dbentry[ndx].deleted = dbp == NULL;
        dblp->dbentry[ndx].dbp = dbp;

    err:    MUTEX_UNLOCK(env, dblp->mtx_dbreg);
        return (ret);
    }
Comment 3 Amit Prakash Ambasta 2017-12-06 12:20:25 UTC
emerge --info

Portage 2.3.16 (python 3.6.3-final-0, default/linux/amd64/17.0/no-multilib, gcc-7.2.0, glibc-2.26-r3, 4.14.2-gentoo x86_64)
=================================================================
System uname: Linux-4.14.2-gentoo-x86_64-Intel-R-_Core-TM-_i5-4210U_CPU_@_1.70GHz-with-gentoo-2.4.1
KiB Mem:    16334380 total,   4346952 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 05 Dec 2017 09:12:43 +0000
Head commit of repository gentoo: 5481daa220c139e9eb1417650645d74836676ea2

Timestamp of repository sublime-text: Thu, 30 Nov 2017 20:52:27 +0000
Head commit of repository sublime-text: 601e7968147be3189b39c34a55d952d189d2f0e5

sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.26.1-r1::gentoo
dev-lang/python:          2.7.14-r1::ambasta, 3.5.4-r1::ambasta, 3.6.3-r1::ambasta
dev-util/cmake:           3.10.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/sandbox:         2.12::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            7.2.0::gentoo
sys-devel/gcc-config:     1.9.0-r1::gentoo
sys-devel/libtool:        2.4.6-r4::gentoo
sys-devel/make:           4.2.1-r1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.26-r3::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

ambasta
    location: /var/lib/layman/ambasta
    masters: gentoo

delhivery
    location: /var/lib/layman/delhivery
    masters: gentoo

sublime-text
    location: /var/db/repos/sublime-text
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/sublime-text.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA google-chrome Sublime Google-TOS PUEL"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=haswell -ftree-vectorize -flto=5 -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/chromium/policies/managed/chrome-gnome-shell.json /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/opt/chrome/policies/managed/chrome-gnome-shell.json /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=haswell -ftree-vectorize -flto=5 -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block"
DISTDIR="/home/portage/distfiles/"
EMERGE_DEFAULT_OPTS="--autounmask=n"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news nodoc noinfo nostrip parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-O2 -pipe -march=haswell -ftree-vectorize -flto=5 -floop-interchange -ftree-loop-distribution -floop-strip-mine -floop-block -fuse-linker-plugin"
MAKEOPTS="-j5"
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="/home/portage/"
USE="X acl amd64 berkdb bzip2 cleartype_hinting cli cracklib crypt cups cxx dbus dri dri3 foomaticdb fuse gdbm glamor gnome gnome-keyring graphite gtk3 iconv introspection lcms libkms lz4 lzma modules ncurses networkmanager nls nptl opencl opengl openmp pam pcre pgo policykit ppds pulseaudio python3 readline seccomp session ssl systemd tcpd udev unicode vulkan wayland xattr zlib" ABI_X86="64" ALSA_CARDS="hda-intel" 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="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" 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" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US" LLVM_TARGETS="X86" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="intel i965 fbdev" 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, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 4 Amit Prakash Ambasta 2017-12-06 12:24:17 UTC
Created attachment 508468 [details]
build.log
Comment 5 Amit Prakash Ambasta 2017-12-06 12:30:35 UTC
Further verified that only line 54 in dbreg_util.c is the one leading to segfault.


> dblp->dbentry[i].deleted = 0;
Comment 6 Amit Prakash Ambasta 2017-12-06 12:36:39 UTC
Finally isolated the CXXFLAGS that cause the segfault to -ftree-loop-distribution and -flto=5

Removing either flto or ftree-loop-distribution or the statement resolves the segfault. Upstream bug perhaps?
Comment 7 Sergei Trofimovich gentoo-dev 2021-01-20 08:44:22 UTC
Does it still happen for you on current toolchains and dependencies? I tried gcc-7.5.0 with your CFLAGS/CXXFLAGS/LDFLAGS and did not get a build crash.