Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 639976 - net-libs/libpcap-1.8.1 with sys-devel/binutils-2.29.1 miscompiles on sparc
Summary: net-libs/libpcap-1.8.1 with sys-devel/binutils-2.29.1 miscompiles on sparc
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: Sparc64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL: https://sourceware.org/git/gitweb.cgi...
Whiteboard:
Keywords: PATCH, TESTFAILURE
Depends on: binutils-2.30-stable
Blocks: 915000 binutils-2.29.1-stable
  Show dependency tree
 
Reported: 2017-12-05 19:52 UTC by Rolf Eike Beer
Modified: 2023-10-01 06:04 UTC (History)
4 users (show)

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


Attachments
tcpdump-build.log.xz (tcpdump-build.log.xz,145.48 KB, application/x-xz)
2017-12-05 19:55 UTC, Rolf Eike Beer
Details
build.log of successful run (build.log,68.74 KB, text/plain)
2017-12-05 19:56 UTC, Rolf Eike Beer
Details
original patch from mailing list (sparc-zero.got.patch,6.17 KB, patch)
2018-04-02 16:46 UTC, Rolf Eike Beer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rolf Eike Beer archtester 2017-12-05 19:52:33 UTC
All test fail in my testing chroot, but they work when I run it on the host (outside the chroot). One difference is the binutils version, but when I switch the binutils version back to 2.28.1 in the chroot and build again the failures persist.

Reproducible: Always
Comment 1 Rolf Eike Beer archtester 2017-12-05 19:52:55 UTC
emerge info from the chroot:

Portage 2.3.8 (python 3.5.4-final-0, default/linux/sparc/13.0, gcc-6.4.0, glibc-2.25-r9, 4.14.2 sparc64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.14.2-sparc64-sun4v-with-gentoo-2.3
KiB Mem:    33133616 total,  14014608 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 05 Dec 2017 12:45:01 +0000
Head commit of repository gentoo: c9ed21226f5634ebe770feefc9b9295627db7378
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14::gentoo, 3.4.5::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.8.2::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.11.6-r2::gentoo, 1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            5.4.0-r3::gentoo, 6.4.0::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.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

ACCEPT_KEYWORDS="sparc"
ACCEPT_LICENSE="* -@EULA"
CBUILD="sparc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=niagara2 -pipe"
CHOST="sparc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.1/ext-active/ /etc/php/cgi-php7.1/ext-active/ /etc/php/cli-php7.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mcpu=niagara2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS=""
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=""
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j20"
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 berkdb big-endian bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 modules ncurses nls nptl openmp pam pcre readline session sparc ssl tcpd unicode xattr zlib" 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" 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" 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" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="fbdev glint mga r128 radeon 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

net-analyzer/tcpdump-4.9.2::gentoo was built with the following:
USE="drop-root smi ssl -libressl -samba -suid -test"
Comment 2 Rolf Eike Beer archtester 2017-12-05 19:53:13 UTC
emerge info from host:

Portage 2.3.8 (python 2.7.14-final-0, default/linux/sparc/13.0, gcc-6.4.0, glibc-2.25-r9, 4.14.2 sparc64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-4.14.2-sparc64-sun4v-with-gentoo-2.3
KiB Mem:    33133616 total,  13992776 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Tue, 05 Dec 2017 12:45:01 +0000
Head commit of repository gentoo: c9ed21226f5634ebe770feefc9b9295627db7378
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.28.1 p1.0) 2.28.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.4.5-r1::gentoo
dev-util/cmake:           3.10.0::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.69::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.28.1::gentoo
sys-devel/gcc:            3.4.6-r2::gentoo, 4.1.2::gentoo, 4.2.4-r1::gentoo, 4.3.6-r1::gentoo, 4.4.7::gentoo, 4.5.4::gentoo, 4.6.4::gentoo, 4.7.4::gentoo, 4.8.5::gentoo, 4.9.4::gentoo, 5.4.0-r3::gentoo, 6.4.0::gentoo, 7.2.0::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.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage
    priority: -1000

dakon
    location: /var/lib/layman/dakon
    masters: gentoo
    priority: 50

local
    location: /usr/local/portage
    masters: gentoo
    priority: 100

ACCEPT_KEYWORDS="sparc"
ACCEPT_LICENSE="* -@EULA"
CBUILD="sparc-unknown-linux-gnu"
CFLAGS="-O2 -mcpu=niagara2 -pipe"
CHOST="sparc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/qmail/alias /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.0/ext-active/ /etc/php/cgi-php7.0/ext-active/ /etc/php/cli-php7.0/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -mcpu=niagara2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="" 
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS=""  
GENTOO_MIRRORS="ftp://ftp.wh2.tu-dresden.de/pub/mirrors/gentoo ftp://ftp.join.uni-muenster.de/pub/linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j20"
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 big-endian bzip2 cli cracklib crypt curl cxx dri fortran gdbm iconv ipv6 modules ncurses nptl openmp pam pcre readline session sparc ssl tcpd unicode xattr zlib" 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" 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" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" L10N="en de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en de" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="fbdev glint mga r128 radeon 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, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

net-analyzer/tcpdump-4.9.2::gentoo was built with the following:
USE="drop-root ssl test -libressl -samba -smi -suid"
Comment 3 Rolf Eike Beer archtester 2017-12-05 19:55:56 UTC
Created attachment 508416 [details]
tcpdump-build.log.xz
Comment 4 Rolf Eike Beer archtester 2017-12-05 19:56:19 UTC
Created attachment 508418 [details]
build.log of successful run
Comment 5 Rolf Eike Beer archtester 2017-12-05 20:09:53 UTC
Seems to be libpcap: if I copy the version from the host into the chroot everything is fine. If I rebuild it inside the chroot, things break again.
Comment 6 Rolf Eike Beer archtester 2017-12-05 20:38:28 UTC
Ok, the culprit is not tcpdump, but libpcap. If I build libpcap with binutils 2.28.1 it works. Building it with 2.29.1 breaks it.
Comment 8 Jeroen Roovers (RETIRED) gentoo-dev 2018-02-11 14:05:27 UTC
(In reply to Rolf Eike Beer from comment #3)
> Created attachment 508416 [details]
> tcpdump-build.log.xz

Looks like it's always 

> EXIT CODE 00000100

so what does that translate to? I _think_ that's a SIGBUG and on SPARC that's usually triggered by unaligned memory access.
Comment 9 Rolf Eike Beer archtester 2018-02-11 14:14:31 UTC
The problem is that there are invalid entries in the GOT, that get used as function pointers or something like that, but point into garbage. Because of a bug in the dynamic linker these values in the GOT do not get ignored as on other platforms. I don't think that writing random offsets into the file is a good idea in any case, so zeroing it out sounds like a sane idea anyway.
Comment 10 Jeroen Roovers (RETIRED) gentoo-dev 2018-02-11 14:24:45 UTC
(In reply to Rolf Eike Beer from comment #9)
> The problem is that there are invalid entries in the GOT, that get used as
> function pointers or something like that, but point into garbage. Because of
> a bug in the dynamic linker these values in the GOT do not get ignored as on
> other platforms. I don't think that writing random offsets into the file is
> a good idea in any case, so zeroing it out sounds like a sane idea anyway.

OK, didn't see your patch reference there.
Comment 11 Sergei Trofimovich (RETIRED) gentoo-dev 2018-02-11 15:43:35 UTC
(In reply to Rolf Eike Beer from comment #7)
> Patch at
> https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;
> h=a9d44aad42e127adadbad35f23931d8d83aa40c1

Cool! That patch is already in 2.30 we only need to backport it to 2.29.1.
Comment 12 Rolf Eike Beer archtester 2018-04-02 16:46:02 UTC
Created attachment 526348 [details, diff]
original patch from mailing list

For reference: this is the original patch from the mailing list which I tested for a while and which has fixed the problem for me.
Comment 13 Andreas K. Hüttel archtester gentoo-dev 2018-04-29 18:51:37 UTC
Fix queued for binutils 2.30 patchset 2
Comment 14 Rolf Eike Beer archtester 2018-04-29 19:03:54 UTC
Isn't this already in 2.30? Or did you mean 2.29 patchset 2?
Comment 15 Andreas K. Hüttel archtester gentoo-dev 2018-04-29 19:39:19 UTC
(In reply to Rolf Eike Beer from comment #14)
> Isn't this already in 2.30? Or did you mean 2.29 patchset 2?

Yep, right, it's already in 2.30
Comment 16 Rolf Eike Beer archtester 2018-07-11 17:53:50 UTC
2.30 is stable.