Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1553705 - binutils: ld SIGSEGV in elf_s390_relocate_section
Summary: binutils: ld SIGSEGV in elf_s390_relocate_section
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: binutils
Version: 27
Hardware: s390x
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Nick Clifton
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: ZedoraTracker 1548438
TreeView+ depends on / blocked
 
Reported: 2018-03-09 11:19 UTC by Florian Weimer
Modified: 2018-11-30 20:19 UTC (History)
4 users (show)

Fixed In Version: binutils-2.29-14.fc27
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 20:19:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
ifuncmod5.os (5.93 KB, application/octet-stream)
2018-03-09 11:19 UTC, Florian Weimer
no flags Details
ifuncmod5.s (13.88 KB, text/plain)
2018-03-09 11:23 UTC, Florian Weimer
no flags Details

Description Florian Weimer 2018-03-09 11:19:20 UTC
Created attachment 1406240 [details]
ifuncmod5.os

As seen with binutils-2.30-10.fc29.s390x.  Object file attached.  Use “ld -shared ifuncmod5.os”.

Backtrace:

#0  bfd_putb64 (data=300, p=0x0) at libbfd.c:715
        addr = 0x0
#1  0x000003fffde53440 in bfd_elf64_swap_reloca_out (abfd=0x2aa000c8a10, 
    src=0x3ffffffec58, d=0x0) at elfcode.h:436
        dst = 0x0
#2  0x000003fffde519d6 in elf_s390_relocate_section (
    output_bfd=output_bfd@entry=0x2aa000c8a10, info=<optimized out>, 
    input_bfd=input_bfd@entry=0x2aa000d5160, 
    input_section=input_section@entry=0x2aa000d66e0, 
    contents=contents@entry=0x2aa00101bb0 "", relocs=0x2aa000e6b28, 
    local_syms=0x2aa000ee0a0, local_sections=0x2aa00102340)
    at elf64-s390.c:2613
        outrel = {r_offset = 300, r_info = 8589934614, r_addend = 0}
        sreloc = <optimized out>
        howto = 0x3fffdefafd0 <elf_howto_table+1760>
        sym = <optimized out>
        sec = 0x2aa000d6350
        unresolved_reloc = <optimized out>
        resolved_to_zero = <optimized out>
        r_symndx = 24
        h = 0x2aa000cb4d0
        off = <optimized out>
        relocation = <optimized out>
        r = <optimized out>
        tls_type = <optimized out>
        base_got = <optimized out>
        r_type = 22
        htab = 0x2aa000cab80
        symtab_hdr = 0x2aa000d5328
        sym_hashes = 0x2aa000e6530
        local_got_offsets = 0x0
        rel = 0x2aa000e6b58
        relend = 0x2aa000e6be8
        __PRETTY_FUNCTION__ = "elf_s390_relocate_section"
#3  0x000003fffde79822 in elf_link_input_bfd (
    flinfo=flinfo@entry=0x3ffffffeff8, input_bfd=input_bfd@entry=0x2aa000d5160)
    at elflink.c:10710
        rel = 0x2aa000e6be8
        relend = 0x2aa000e6be8
        action_discarded = 3
        ret = <optimized out>
        internal_relocs = 0x2aa000e6b28
        contents = 0x2aa00101bb0 ""
        relocate_section = <optimized out>
        output_bfd = <optimized out>
        symtab_hdr = 0x2aa000d5328
        locsymcount = 23
        extsymoff = 23
        isymbuf = 0x2aa000ee0a0
        isym = <optimized out>
        isymend = <optimized out>
        pindex = <optimized out>
        ppsection = <optimized out>
        o = 0x2aa000d66e0
        bed = <optimized out>
        sym_hashes = 0x2aa000e6530
        address_size = 8
        r_type_mask = 4294967295
        r_sym_shift = 32
        have_file_sym = <optimized out>
        __PRETTY_FUNCTION__ = "elf_link_input_bfd"
#4  0x000003fffde7b452 in bfd_elf_final_link (abfd=0x2aa000c8a10, 
    info=<optimized out>) at elflink.c:12021
        dynamic = <optimized out>
        emit_relocs = <optimized out>
        dynobj = 0x2aa000d5160
        flinfo = {info = 0x2aa000b2438 <link_info>, 
          output_bfd = 0x2aa000c8a10, symstrtab = 0x2aa000d4b70, 
          hash_sec = 0x2aa000da7a8, symver_sec = 0x2aa000da1b8, 
          contents = 0x2aa00101bb0 "", external_relocs = 0x2aa000d4290, 
          internal_relocs = 0x2aa00101da0, external_syms = 0x2aa000d4d20 "", 
          locsym_shndx = 0x0, internal_syms = 0x2aa00102050, 
          indices = 0x2aa000b4230, sections = 0x2aa00102340, 
          symshndxbuf = 0x0, filesym_count = 1}
        o = 0x2aa000c9c00
        p = 0x2aa000ec480
        sub = 0x2aa000d5160
        max_contents_size = <optimized out>
        max_external_reloc_size = <optimized out>
        max_internal_reloc_count = <optimized out>
        max_sym_count = <optimized out>
        max_sym_shndx_count = <optimized out>
        elfsym = {st_value = 0, st_size = 0, st_name = 18446744073709551615, 
          st_info = 3 '\003', st_other = 0 '\000', 
          st_target_internal = 0 '\000', st_shndx = 18}
        i = <optimized out>
        symtab_hdr = <optimized out>
        symtab_shndx_hdr = <optimized out>
        bed = <optimized out>
        eoinfo = {failed = 1023, localsyms = -33927360, file_sym_done = 0, 
          flinfo = 0x2aa000ee460}
        merged = <optimized out>
        relativecount = 0
        reldyn = 0x0
        amt = <optimized out>
        attr_section = <optimized out>
        attr_size = <optimized out>
        std_attrs_section = <optimized out>
        htab = <optimized out>
        __PRETTY_FUNCTION__ = "bfd_elf_final_link"
#5  0x000002aa0002620a in ldwrite () at ldwrite.c:581
No locals.
#6  0x000002aa0000c26a in main (argc=<optimized out>, argv=<optimized out>)
    at ./ldmain.c:424
        emulation = 0x2aa0004bc24 "elf64_s390"
        start_time = 2168

It's annobin-related:

(gdb) print *input_section
$1 = {name = 0x2aa000d605e ".gnu.build.attributes", id = 19, index = 3, 
  next = 0x2aa000d6810, prev = 0x2aa000d65b0, flags = 268, user_set_vma = 1, 
  linker_mark = 1, linker_has_input = 0, gc_mark = 0, compress_status = 0, 
  segment_mark = 0, sec_info_type = 0, use_rela_p = 1, sec_flg0 = 0, 
  sec_flg1 = 0, sec_flg2 = 0, sec_flg3 = 0, sec_flg4 = 0, sec_flg5 = 0, 
  vma = 0, lma = 0, size = 388, rawsize = 0, compressed_size = 0, relax = 0x0, 
  relax_count = 0, output_offset = 0, output_section = 0x2aa000ea2f0, 
  alignment_power = 2, relocation = 0x0, orelocation = 0x0, reloc_count = 8, 
  filepos = 236, rel_filepos = 3304, line_filepos = 0, userdata = 0x0, 
  contents = 0x0, lineno = 0x0, lineno_count = 0, entsize = 0, 
  kept_section = 0x0, moving_line_filepos = 0, target_index = 0, 
  used_by_bfd = 0x2aa000d9040, constructor_chain = 0x0, owner = 0x2aa000d5160, 
  symbol = 0x2aa000d9120, symbol_ptr_ptr = 0x2aa000d67d8, map_head = {
    link_order = 0x0, s = 0x0}, map_tail = {link_order = 0x0, s = 0x0}}

Comment 1 Florian Weimer 2018-03-09 11:22:50 UTC
I see that there's a previous assertion failure printed:

/usr/bin/ld: BFD version 2.30-10.fc29 assertion fail elflink.c:14313

14308   void
14309   elf_append_rela (bfd *abfd, asection *s, Elf_Internal_Rela *rel)
14310   {
14311     const struct elf_backend_data *bed = get_elf_backend_data (abfd);
14312     bfd_byte *loc = s->contents + (s->reloc_count++ * bed->s->sizeof_rela);
14313     BFD_ASSERT (loc + bed->s->sizeof_rela <= s->contents + s->size);
14314     bed->s->swap_reloca_out (abfd, rel, loc);
14315   }

Comment 2 Florian Weimer 2018-03-09 11:23:44 UTC
Created attachment 1406243 [details]
ifuncmod5.s

Corresponding assembler input file

Comment 3 Florian Weimer 2018-03-09 11:27:11 UTC
A couple of other IFUNC tests in the glibc test suite trigger this asserts.

Comment 4 Nick Clifton 2018-03-09 14:42:14 UTC
This is basically the same as BZ 1552056, except that it is the S390x that
is affected this time.  (In fact it turns out that the AArch64 target will
also have this problem).

I have created a patch to fix the problem, and applied it upstream:

  https://www.sourceware.org/ml/binutils/2018-03/msg00157.html

I am going to backport this patch to Fedora and update this BZ once that 
is done.

Comment 5 Nick Clifton 2018-03-09 17:27:06 UTC
The patch is now in:

  binutils-2.29-14.fc27
  binutils-2.29.1-22.fc28
  binutils-2.30-12.fc29

Cheers
  Nick

Comment 6 Ben Cotton 2018-11-27 16:41:38 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 7 Ben Cotton 2018-11-30 20:19:32 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


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