Bug 1609182 - binutils: Linker produces corrupt dynamic linking information
Summary: binutils: Linker produces corrupt dynamic linking information
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1609062 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-27 08:48 UTC by Vít Ondruch
Modified: 2018-08-02 11:56 UTC (History)
16 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-07-28 15:28:36 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
libruby.so.2.5 (3.06 MB, application/octet-stream)
2018-07-27 10:31 UTC, Florian Weimer
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1609069 0 urgent CLOSED ld segfaults on x86_64, i686 and armv7hl 2021-02-22 00:41:40 UTC

Internal Links: 1609069

Description Vít Ondruch 2018-07-27 08:48:01 UTC
Description of problem:
It seems that Ruby segfaults after recent rebuild on all arches except x86_64:

https://apps.fedoraproject.org/koschei/search?q=ruby

This is the trace I get trying to reproduce the issue in i686 mock:

~~~
$ gdb ruby-mri
GNU gdb (GDB) Fedora 8.1.90.20180714-35.fc29
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "i686-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ruby-mri...Reading symbols from /usr/lib/debug/usr/bin/ruby-mri-2.5.1-94.fc29.i386.debug...done.
done.
(gdb) r -S gem install escape
Starting program: /usr/bin/ruby-mri -S gem install escape

Program received signal SIGSEGV, Segmentation fault.
do_lookup_x (undef_name=undef_name@entry=0xf798d820 "__tzname", new_hash=new_hash@entry=3497125970, old_hash=old_hash@entry=0xffffd30c, ref=0xf7983440, result=0xffffd314, scope=0xf7ffda60, i=<optimized out>, 
    version=0xf7fcbb60, flags=1, skip=0x0, type_class=4, undef_map=0xf7fcb030) at dl-lookup.c:404
404			    if (((*hasharr ^ new_hash) >> 1) == 0)
(gdb) where 
#0  do_lookup_x (undef_name=undef_name@entry=0xf798d820 "__tzname", new_hash=new_hash@entry=3497125970, old_hash=old_hash@entry=0xffffd30c, ref=0xf7983440, result=0xffffd314, scope=0xf7ffda60, 
    i=<optimized out>, version=0xf7fcbb60, flags=1, skip=0x0, type_class=4, undef_map=0xf7fcb030) at dl-lookup.c:404
#1  0xf7fdf513 in _dl_lookup_symbol_x (undef_name=0xf798d820 "__tzname", undef_map=0xf7fcb030, ref=0xffffd3cc, symbol_scope=0xf7fcb1ec, version=0xf7fcbb60, type_class=4, flags=1, skip_map=0x0)
    at dl-lookup.c:814
#2  0xf7fe1376 in elf_machine_rel (skip_ifunc=<optimized out>, reloc_addr_arg=0xf7b22eec, version=<optimized out>, sym=<optimized out>, reloc=0xf7996604, map=0xf7fcb030) at ../sysdeps/i386/dl-machine.h:322
#3  elf_dynamic_do_Rel (skip_ifunc=<optimized out>, lazy=<optimized out>, nrelative=<optimized out>, relsize=<optimized out>, reladdr=<optimized out>, map=<optimized out>) at do-rel.h:137
#4  _dl_relocate_object (scope=<optimized out>, reloc_mode=<optimized out>, consider_profiling=<optimized out>) at dl-reloc.c:258
#5  0xf7fd8dae in dl_main (phdr=<optimized out>, phnum=<optimized out>, user_entry=<optimized out>, auxv=<optimized out>) at rtld.c:2184
#6  0xf7feda18 in _dl_sysdep_start (start_argptr=0xffffd6d0, dl_main=0xf7fd6ea0 <dl_main>) at ../elf/dl-sysdep.c:253
#7  0xf7fd6a4f in _dl_start_final (arg=0xffffd6d0) at rtld.c:412
#8  _dl_start (arg=<optimized out>) at rtld.c:519
#9  0xf7fd5b1b in _start () from /lib/ld-linux.so.2
~~~


Version-Release number of selected component (if applicable):
$ rpm -q ruby
ruby-2.5.1-94.fc29.i686


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
Ruby (actually probably dynamic linker?) segfaults on load.


Expected results:
Ruby runs just fine


Additional info:

Comment 1 Florian Weimer 2018-07-27 09:18:47 UTC
/lib/libruby.so.2.5 is corrupt.

# readelf -Ds /lib/libruby.so.2.5
readelf: /lib/libruby.so.2.5: Warning: Virtual address 0xb99dab38 not located in any PT_LOAD segment.
readelf: /lib/libruby.so.2.5: Error: Unable to seek to start of dynamic information

I saw some discussion about a binutils bug, so I'm reassigning to binutils.

Comment 2 Florian Weimer 2018-07-27 10:31:32 UTC
Created attachment 1471046 [details]
libruby.so.2.5

The corrupt shared object.

Comment 3 Robbie Harwood 2018-07-27 17:53:46 UTC
*** Bug 1609062 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.