Summary: | sys-libs/glibc-2.25-r5 fails with binutils-2.29: segfault running simple test during pkg_preinst on arm64 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Steve Arnold <nerdboy> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | major | CC: | arm64, slyfox |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | ARM64 | ||
OS: | Linux | ||
URL: | https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=e9177fba13549a8e2a6232f46080e5c6d3e467b1 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 628180 | ||
Attachments: |
failed build with binutils 2.29
good build log with binutils 2.27 0001-AArch64-Use-hidden-__GI__dl_argv-in-rtld-startup-cod.patch |
Description
Steve Arnold
![]() ![]() The above is from testing upstream patch but it didn't help this issue (same error either way. Also note that I grabbed this info *after* switching back to previous binutils so I could try installing 2.28.1 (and note that glibc2.25 *did* install fine with binutils 2.27 and gcc 7.2.0). # emerge --info Portage 2.3.8 (python 2.7.12-final-0, default/linux/arm64/13.0, gcc-7.2.0, glibc-2.24-r1, 4.12.0-rc1-00064-g15e858ec0c62 aarch64) ================================================================= System uname: Linux-4.12.0-rc1-00064-g15e858ec0c62-aarch64-with-gentoo-2.3 KiB Mem: 2034716 total, 734152 free KiB Swap: 1548280 total, 1541624 free Timestamp of repository gentoo: Mon, 18 Sep 2017 10:30:01 +0000 Head commit of repository gentoo: 549cec3ba388acb4c0c03980af3bea5506cb8216 sh bash 4.3_p48-r1 ld GNU gold (Gentoo 2.27 p1.0 2.27) 1.12 distcc 3.2rc1 aarch64-unknown-linux-gnu [disabled] ccache version 3.3.4 [enabled] app-shells/bash: 4.3_p48-r1::gentoo dev-lang/perl: 5.24.1-r1::gentoo dev-lang/python: 2.7.12::gentoo, 3.4.5::gentoo dev-util/ccache: 3.3.4::gentoo dev-util/pkgconfig: 0.28-r2::gentoo sys-apps/baselayout: 2.3::gentoo sys-apps/openrc: 0.23.2::gentoo sys-apps/sandbox: 2.10-r1::gentoo sys-devel/autoconf: 2.69::gentoo sys-devel/automake: 1.14.1::gentoo, 1.15::gentoo sys-devel/binutils: 2.25.1-r1::gentoo, 2.27::gentoo, 2.29::gentoo sys-devel/gcc: 4.9.4::gentoo, 5.4.0-r3::gentoo, 6.4.0::ada, 7.2.0::ada sys-devel/gcc-config: 1.7.3::gentoo sys-devel/libtool: 2.4.6-r3::gentoo sys-devel/make: 4.1-r1::gentoo sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers) sys-libs/glibc: 2.24-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-umask: 022 sync-uri: rsync://prime.arnolds.bogus/gentoo-portage sync-user: portage:portage priority: -1000 eclass-overrides: nerdboy nerdboy location: /usr/local/portage masters: gentoo priority: 0 arm_support location: /usr/local/arm masters: gentoo priority: 1 ODROID-C2 location: /var/lib/layman/ODROID-C2 sync-type: laymansync sync-umask: 022 sync-uri: https://github.com/nxmyoz/c2-overlay.git sync-user: portage:portage masters: gentoo priority: 50 ada location: /var/lib/layman/ada sync-type: laymansync sync-umask: 022 sync-uri: git://github.com/sarnold/ada-overlay.git sync-user: portage:portage masters: gentoo priority: 50 ACCEPT_KEYWORDS="arm64 ~arm64" ACCEPT_LICENSE="* -@EULA @GPL-COMPATIBLE @OSI-APPROVED @EULA dlj-1.1 skype-eula googleearth AdobeFlash-10.1 Oracle-BCLA-JavaSE" CBUILD="aarch64-unknown-linux-gnu" CFLAGS="-march=armv8-a+crc+fp+simd -mabi=lp64 -mcpu=cortex-a53+crc+fp+simd -O2 -pipe -ftree-vectorize -ftree-loop-distribution -fvect-cost-model=cheap -flto=4" CHOST="aarch64-unknown-linux-gnu" CONFIG_PROTECT="/etc" 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=armv8-a+crc+fp+simd -mabi=lp64 -mcpu=cortex-a53+crc+fp+simd -O2 -pipe -ftree-vectorize -ftree-loop-distribution -fvect-cost-model=cheap -flto=4" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2" FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news nodoc parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.utf8" LDFLAGS="-march=armv8-a+crc+fp+simd -mabi=lp64 -mcpu=cortex-a53+crc+fp+simd -O2 -pipe -ftree-vectorize -ftree-loop-distribution -fvect-cost-model=cheap -flto=4 -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="/var/tmp" USE="acl alsa arm64 berkdb bzip2 caps cli consolekit cracklib crypt curl cxx dnotify dri drm evdev fbcon fortran gdbm gnutls gpm gudev guile iconv inotify ipv6 jpeg json kms libav logrotate lto lua lzma modules multilib ncurses nls nolvmstatic nptl openmp pam pcre pic png python qt readline seccomp session ssh ssl tcpd threads tls tslib udev unicode vala wheel xattr zip zlib" ALSA_CARDS="usb-audio" APACHE2_MODULES="actions alias auth_digest 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 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 proxy proxy_connect proxy_http 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_ARM="edsp neon thumb vfp vfpv3 vfpv4 vfp-d32 crc32 v4 v5 v6 v7 v8 thumb2" CURL_SSL="openssl" 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="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en_US en" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_4" PYTHON_TARGETS="python2_7 python3_4" RUBY_TARGETS="ruby21 ruby22" USERLAND="GNU" VIDEO_CARDS="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, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS Get same issue # uname -a Linux rpi3 4.13.4-gentoo #1 SMP Sat Sep 30 02:14:27 MSK 2017 aarch64 GNU/Linux [47345.711352] ld-2.25.so[18173]: unhandled level 3 permission fault (11) at 0xffffbe36cff8, esr 0x9200004f, in ld-2.25.so[ffffbe36c000+1c000] [47345.711382] CPU: 2 PID: 18173 Comm: ld-2.25.so Not tainted 4.13.4-gentoo #1 [47345.711386] Hardware name: Raspberry Pi 3 Model B Rev 1.2 (DT) [47345.711392] task: ffff800038dd8d80 task.stack: ffff800038b48000 [47345.711401] PC is at 0xffffbe36cc28 [47345.711405] LR is at 0xffffbe36cbc8 [47345.711410] pc : [<0000ffffbe36cc28>] lr : [<0000ffffbe36cbc8>] pstate: 60000000 [47345.711413] sp : 0000ffffd8c28410 [47345.711416] x29: 0000000000000000 x28: 0000000000000000 [47345.711425] x27: 0000000000000000 x26: 0000000000000000 [47345.711433] x25: 0000000000000000 x24: 0000000000000000 [47345.711442] x23: 0000000000000000 x22: 0000000000000000 [47345.711450] x21: 00000000004031d0 x20: 0000000000000000 [47345.711458] x19: 0000000000000000 x18: 0000000000000a03 [47345.711466] x17: 0000ffffbe380798 x16: 0000ffffbe397f88 [47345.711475] x15: 0000000000000000 x14: 00000000000006fa [47345.711483] x13: 0000ffffbe397fb8 x12: 0000ffffbe398000 [47345.711491] x11: 0000000000000000 x10: 0101010101010101 [47345.711499] x9 : 0000000000000000 x8 : 00000000000000d7 [47345.711507] x7 : 00000000002deb02 x6 : 00000000000006fa [47345.711515] x5 : 0000000000000000 x4 : 0000ffffd8c28b88 [47345.711524] x3 : 0000ffffbe36c000 x2 : 0000ffffd8c28418 [47345.711532] x1 : 0000000000000001 x0 : 0000000000000000 # emerge --info Portage 2.3.6 (python 3.6.1-final-0, default/linux/arm64/13.0, gcc-6.4.0, glibc-2.24-r1, 4.13.4-gentoo aarch64) ================================================================= System uname: Linux-4.13.4-gentoo-aarch64-with-gentoo-2.4.1 KiB Mem: 939740 total, 279088 free KiB Swap: 2097148 total, 2092028 free Timestamp of repository gentoo: Fri, 29 Sep 2017 19:00:01 +0000 sh bash 4.4_p12 ld GNU ld (Gentoo 2.29.1 p1.0) 2.29.1 app-shells/bash: 4.4_p12::gentoo dev-lang/perl: 5.24.1-r2::gentoo dev-lang/python: 2.7.13::gentoo, 3.6.1-r1::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1::gentoo sys-apps/openrc: 0.27.2::gentoo sys-apps/sandbox: 2.10-r4::gentoo sys-devel/autoconf: 2.69-r3::gentoo sys-devel/automake: 1.13.4-r1::gentoo, 1.14.1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.25.1-r1::gentoo, 2.27::gentoo, 2.28-r2::gentoo, 2.29.1::gentoo sys-devel/gcc: 6.3.0::gentoo, 6.4.0::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r4::gentoo sys-devel/make: 4.2.1-r1::gentoo sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.24-r1::gentoo Repositories: gentoo location: /usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 ACCEPT_KEYWORDS="arm64 ~arm64" ACCEPT_LICENSE="* -@EULA" CBUILD="aarch64-unknown-linux-gnu" CFLAGS="-O2 -pipe -march=armv8-a+crc -mtune=cortex-a53" CHOST="aarch64-unknown-linux-gnu" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2" DISTDIR="/usr/portage/distfiles" FCFLAGS="-O2" 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="-O2" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="ru_RU.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" 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="/var/tmp" USE="acl arm64 berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm iconv ipv6 lzma modules multilib ncurses nls nptl openmp pam pcre readline seccomp session 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" CPU_FLAGS_ARM="edsp neon thumb thumb2 v4 v5 v6 v7 v8 vfp vfp-d32 vfpv3 vfpv4" 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" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" USERLAND="GNU" VIDEO_CARDS="fbdev 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 It means glibc miscompiled.
Can you build glibc with debugging symbols (CFLAGS+=-ggdb or something like that)
and get a backktrace to get the idea where it crashes? Something like
that should work:
$ LC_ALL=C gdb --args ./ld-*.so --library-path . /bin/ls
> run
> bt full
On top of that you can also try to disable stack protection which gentoo first enabled in 2.25: $ EXTRA_ECONF=--enable-stack-protector=no emerge -1 glibc Created attachment 497384 [details]
failed build with binutils 2.29
Note the (internal) locale gen failures during the build.
Created attachment 497386 [details]
good build log with binutils 2.27
Created attachment 497414 [details, diff] 0001-AArch64-Use-hidden-__GI__dl_argv-in-rtld-startup-cod.patch Please try attached glibc patch: 0001-AArch64-Use-hidden-__GI__dl_argv-in-rtld-startup-cod.patch The crash happens in ld-linux code responsible for argument parsing. Was already fixed upstream as: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=e9177fba13549a8e2a6232f46080e5c6d3e467b1 It was immediately obvious from the backtrace: #0 elf_machine_rela (skip_ifunc=0, reloc_addr_arg=0x0, version=<optimized out>, sym=0x0, reloc=0x0, map=0x0) at ../sysdeps/aarch64/dl-machine.h:370 #1 elf_dynamic_do_Rela (skip_ifunc=0, lazy=0, nrelative=<optimized out>, relsize=<optimized out>, reladdr=<optimized out>, map=0x0) at do-rel.h:137 #2 _dl_start (arg=<optimized out>) at rtld.c:489 Backtrace stopped: Cannot access memory at address 0x8 But perhaps you are triggering another/more issues. Still seeing a lot of these, although the patch does make glibc compile. /usr/lib/portage/python2.7/ebuild-helpers/prepstrip: line 177: 5803 Illegal instruction ${STRIP} ${strip_flags} "${x}" (In reply to Steve Arnold from comment #9) > Still seeing a lot of these, although the patch does make glibc compile. > > /usr/lib/portage/python2.7/ebuild-helpers/prepstrip: line 177: 5803 Illegal > instruction ${STRIP} ${strip_flags} "${x}" This looks different. As if gcc decided to generate instruction CPU does not understand (or not configured to undefrstand by kernel. If you know precise address illegal instruction happened you can find out what was actually generated by running 'disassemble' in gdb or run objdump. Then we can check if your chip can do it and which gcc/binutils option enables them. With this patch glibc compiles for me on arm64 rpi3 ~ # emerge --info Portage 2.3.11 (python 3.6.1-final-0, default/linux/arm64/13.0, gcc-6.4.0, glibc-2.25-r5, 4.13.4-gentoo aarch64) ================================================================= System uname: Linux-4.13.4-gentoo-aarch64-with-gentoo-2.4.1 KiB Mem: 873128 total, 510260 free KiB Swap: 2097148 total, 2095868 free Timestamp of repository gentoo: Tue, 03 Oct 2017 10:30:01 +0000 Head commit of repository gentoo: 8e7a474a2e54514039770554fa2ce98b40a91a8a sh bash 4.4_p12 ld GNU ld (Gentoo 2.29.1 p1.0) 2.29.1 app-shells/bash: 4.4_p12::gentoo dev-lang/perl: 5.24.1-r2::gentoo dev-lang/python: 2.7.13::gentoo, 3.6.1-r1::gentoo dev-util/pkgconfig: 0.29.2::gentoo sys-apps/baselayout: 2.4.1::gentoo sys-apps/openrc: 0.27.2::gentoo sys-apps/sandbox: 2.10-r4::gentoo sys-devel/autoconf: 2.69-r3::gentoo sys-devel/automake: 1.13.4-r1::gentoo, 1.14.1::gentoo, 1.15-r2::gentoo sys-devel/binutils: 2.25.1-r1::gentoo, 2.27::gentoo, 2.28-r2::gentoo, 2.29.1::gentoo sys-devel/gcc: 6.3.0::gentoo, 6.4.0::gentoo sys-devel/gcc-config: 1.8-r1::gentoo sys-devel/libtool: 2.4.6-r4::gentoo sys-devel/make: 4.2.1-r1::gentoo sys-kernel/linux-headers: 4.10::gentoo (virtual/os-headers) sys-libs/glibc: 2.25-r5::gentoo Patch added to our patchset, will be in the next revbump That was on pine64, should be standard armv8-a; the strip errors are only with binutils 2.29, however 2.29.1 looks okay. (In reply to Steve Arnold from comment #13) > That was on pine64, should be standard armv8-a; the strip errors are only > with binutils 2.29, however 2.29.1 looks okay. OK. I'm still waiting for a response from hppa for a different issue, then I'll make 2.25-r6 with this patch included. (In reply to Andreas K. Hüttel from comment #14) > (In reply to Steve Arnold from comment #13) > > That was on pine64, should be standard armv8-a; the strip errors are only > > with binutils 2.29, however 2.29.1 looks okay. > > OK. I'm still waiting for a response from hppa for a different issue, then > I'll make 2.25-r6 with this patch included. Bumped. Please make a separate bug for separate issues. |