Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 601536 - sys-libs/glibc: running `ldd` on splitdebug files triggers a Segmentation fault in _dl_relocate_object
Summary: sys-libs/glibc: running `ldd` on splitdebug files triggers a Segmentation fau...
Status: RESOLVED DUPLICATE of bug 364689
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-03 20:00 UTC by Thomas Deutschmann (RETIRED)
Modified: 2016-12-06 03:54 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-03 20:00:27 UTC
Hi,

after running "/usr/bin/revdep-rebuild.sh" from =app-portage/gentoolkit-0.3.2-r1::gentoo I noticed that dmesg logged hundreds of

> ld-linux.so.2[114261]: segfault at 4 ip 000000005661fe77 sp 00000000ff96c5c0 error 4 in ld-2.23.so[56615000+22000]

messages and my directory where I save core dumps (which was empty before) contained 622 files like "ld-linux.so.2.32483.1480792708".

I was able to trace the problem down to files in "/usr/lib64/debug/".

It crashes in ldd's try_trace function. You can reproduce this problem when you emerge =sys-libs/glibc-2.23-r3:2.2::gentoo with an ENV file like

CFLAGS="${CFLAGS} -ggdb"
CXXFLAGS="${CXXFLAGS} -ggdb"
FEATURES="${FEATURES} splitdebug"
FEATURES="${FEATURES} compressdebug"


Now just run

# LD_TRACE_LOADED_OBJECTS=1 LD_WARN=yes LD_BIND_NOW=yes LD_VERBOSE= /lib/ld-linux.so.2 /usr/lib64/debug/usr/lib32/gconv/CP770.so.debug
    statically linked
Segmentation fault (core dumped)


Backtrace:

Core was generated by `/lib/ld-linux.so.2 /usr/lib64/debug/usr/lib32/gconv/CP770.so.debug'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x565d1e77 in _dl_relocate_object (scope=0x565eaae0, reloc_mode=33554432, consider_profiling=0) at dl-reloc.c:232
232     dl-reloc.c: No such file or directory.
(gdb) bt
#0  0x565d1e77 in _dl_relocate_object (scope=0x565eaae0, reloc_mode=33554432, consider_profiling=0) at dl-reloc.c:232
#1  0x565c7cfa in relocate_doit (a=0xffe90170) at rtld.c:475
#2  0x565d623a in _dl_receive_error (fct=fct@entry=0x565c7b70 <print_unresolved>, operate=operate@entry=0x565c7ce0 <relocate_doit>, args=args@entry=0xffe90170) at dl-error.c:217
#3  0x565ca8e4 in dl_main (phdr=0xf7787034, phnum=7, user_entry=0xffe901cc, auxv=0xffe90324) at rtld.c:1831
#4  0x565dd1e0 in _dl_sysdep_start (start_argptr=0xffe90250, dl_main=0x565c8460 <dl_main>) at ../elf/dl-sysdep.c:249
#5  0x565cb9a1 in _dl_start_final (arg=0xffe90250) at rtld.c:307
#6  _dl_start (arg=0xffe90250) at rtld.c:413
#7  0x565c7a37 in _start ()



# emerge --info
Portage 2.3.2 (python 3.5.2-final-0, default/linux/amd64/13.0, gcc-5.4.0, glibc-2.23-r3, 4.8.12-gentoo x86_64)
=================================================================
System uname: Linux-4.8.12-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770K_CPU_@_3.50GHz-with-gentoo-2.3
KiB Mem:     8138620 total,   7000716 free
KiB Swap:    1048572 total,   1048572 free
Timestamp of repository gentoo: Sat, 03 Dec 2016 10:51:22 +0000
sh dash 0.5.9.1-r1
ld GNU ld (Gentoo 2.27 p1.0) 2.27
app-shells/bash:          4.4_p5-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.24.1_rc4::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo, 3.5.2::gentoo
dev-util/cmake:           3.7.1::gentoo
dev-util/pkgconfig:       0.29.1::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.4::gentoo
sys-apps/sandbox:         2.10-r2::gentoo
sys-devel/autoconf:       2.69-r2::gentoo
sys-devel/automake:       1.13.4-r1::gentoo, 1.14.1-r1::gentoo, 1.15-r2::gentoo
sys-devel/binutils:       2.27::gentoo
sys-devel/gcc:            5.4.0::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.23-r3::gentoo

ABI="amd64"
ABI_X86="64"
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
ACCEPT_PROPERTIES="*"
ACCEPT_RESTRICT="*"
ARCH="amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=ivybridge -mtune=ivybridge -mno-xsaveopt -frecord-gcc-switches"
CFLAGS_amd64="-m64"
CFLAGS_x32="-mx32"
CFLAGS_x86="-m32"
CHOST="x86_64-pc-linux-gnu"
CHOST_amd64="x86_64-pc-linux-gnu"
CHOST_x32="x86_64-pc-linux-gnux32"
CHOST_x86="i686-pc-linux-gnu"
COLLISION_IGNORE="/lib/modules/* *.py[co] *$py.class */dropin.cache"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3"
CURL_SSL="gnutls"
CXXFLAGS="-O2 -pipe -march=ivybridge -mtune=ivybridge -mno-xsaveopt -frecord-gcc-switches"
DEFAULT_ABI="amd64"
EDITOR="/bin/nano"
ELIBC="glibc"
EPREFIX=""
EROOT="/"
FCFLAGS="-O2 -pipe -march=ivybridge -mtune=ivybridge -mno-xsaveopt -frecord-gcc-switches"
FEATURES="assume-digests binpkg-logs cgroup config-protect-if-modified distlocks downgrade-backup ebuild-locks fixlafiles ipc-sandbox merge-sync network-sandbox news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe -march=ivybridge -mtune=ivybridge -mno-xsaveopt -frecord-gcc-switches"
GCC_SPECS=""
GRUB_PLATFORMS=""
GUILE_LOAD_PATH="/usr/share/guile/2.0"
HOME="/root"
INFOPATH="/usr/share/info:/usr/share/gcc-data/x86_64-pc-linux-gnu/5.4.0/info:/usr/share/binutils-data/x86_64-pc-linux-gnu/2.27/info"
INPUT_DEVICES="keyboard mouse evdev"
IUSE_IMPLICIT="abi_x86_64 prefix prefix-guest"
JAVAC="/etc/java-config-2/current-system-vm/bin/javac"
JAVA_HOME="/etc/java-config-2/current-system-vm"
JDK_HOME="/etc/java-config-2/current-system-vm"
KERNEL="linux"
L10N="en en-US de de-DE fr"
LANG="en_US.UTF-8"
LC_MESSAGES="C"
LC_NUMERIC="de_DE.UTF-8"
LC_PAPER="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LDFLAGS_amd64="-m elf_x86_64"
LDFLAGS_x32="-m elf32_x86_64"
LDFLAGS_x86="-m elf_i386"
LIBDIR_amd64="lib64"
LIBDIR_amd64_fbsd="lib64"
LIBDIR_arm="lib"
LIBDIR_arm64="lib64"
LIBDIR_n32="lib32"
LIBDIR_n64="lib64"
LIBDIR_o32="lib"
LIBDIR_ppc="lib32"
LIBDIR_ppc64="lib64"
LIBDIR_s390="lib32"
LIBDIR_s390x="lib64"
LIBDIR_sparc32="lib32"
LIBDIR_sparc64="lib64"
LIBDIR_x32="libx32"
LIBDIR_x86="lib32"
LIBDIR_x86_fbsd="lib32"
LINGUAS="en de fr"
LOGNAME="root"
MAIL="/var/mail/root"
MAKEOPTS="--jobs 6"
MULTILIB_ABIS="amd64 x86"
NOCOLOR="true"
OFFICE_IMPLEMENTATION="libreoffice"
OPENCL_PROFILE="mesa"
OPENGL_PROFILE="xorg-x11"
ORACLE_HOME="/usr/lib64/oracle/12.1/client"
PAGER="/usr/bin/less"
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0"
PHP_TARGETS="php5-6"
PWD="/root"
PYTHONDONTWRITEBYTECODE="1"
PYTHON_SINGLE_TARGET="python2_7"
PYTHON_TARGETS="python2_7 python3_4 python3_5"
QT_GRAPHICSSYSTEM="raster"
ROOT="/"
ROOTPATH="/opt/bin:/usr/x86_64-pc-linux-gnu/gcc-bin/5.4.0"
RUBY_TARGETS="ruby22"
SHELL="/bin/bash"
SHLVL="2"
SSH_TTY="/dev/pts/0"
SYMLINK_LIB="yes"
TERM="screen"
TMUX="/tmp/tmux-0/default,4645,0"
TMUX_PANE="%2"
TNS_ADMIN="/etc/oracle/"
USER="root"
USERLAND="GNU"
VIDEO_CARDS="vmware"
Comment 1 SpanKY gentoo-dev 2016-12-05 18:44:12 UTC
running ld-linux directly on splitdebug files is expected to crash.  that's simply WAI -- there's no real code in there to execute.

however, ldd shouldn't have tried in the first place because the files are supposed to not be +x.  revdep-rebuild also should have ignored splitdebug files since tracking their deps makes no sense.

so let's back up:
(1) are those files installed +x ?  what if you delete them by hand and re-emerge them ?  pick a small program rather than having to rebuild glibc all the time.
(2) if they aren't +x, then we can bounce this over to revdep-rebuild.
Comment 2 Thomas Deutschmann (RETIRED) gentoo-dev 2016-12-06 03:14:17 UTC
(In reply to SpanKY from comment #1)
> so let's back up:
> (1) are those files installed +x ?  what if you delete them by hand and
> re-emerge them ?  pick a small program rather than having to rebuild glibc
> all the time.

I re-emerged app-admin/rsyslog.

No, no +x ...and revdep-rebuild.sh logs that (via ldd), from "/var/cache/revdep-rebuild/3_errors.rr":

> ldd: warning: you do not have execution permission for `/usr/lib64/debug/usr/lib64/rsyslog/imuxsock.so.debug'
> [...]


# stat /usr/lib64/debug/usr/lib64/rsyslog/imuxsock.so.debug
  File: /usr/lib64/debug/usr/lib64/rsyslog/imuxsock.so.debug
  Size: 54336           Blocks: 112        IO Block: 4096   regular file
Device: fe02h/65026d    Inode: 183892      Links: 1
Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2016-12-06 04:08:31.613820443 +0100
Modify: 2016-12-06 02:59:25.144287589 +0100
Change: 2016-12-06 02:59:27.183310257 +0100
 Birth: -




> (2) if they aren't +x, then we can bounce this over to revdep-rebuild.

Please proceed.
Comment 3 SpanKY gentoo-dev 2016-12-06 03:54:03 UTC
looks like we already have such a bug report open :(

*** This bug has been marked as a duplicate of bug 364689 ***