bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gold/20642] New: internal error in get_section_contents, at icf.cc:


From: guillaume at morinfr dot org
Subject: [Bug gold/20642] New: internal error in get_section_contents, at icf.cc:467 with --icf=safe
Date: Tue, 27 Sep 2016 17:35:10 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=20642

            Bug ID: 20642
           Summary: internal error in get_section_contents, at icf.cc:467
                    with --icf=safe
           Product: binutils
           Version: 2.28 (HEAD)
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gold
          Assignee: ccoutant at gmail dot com
          Reporter: guillaume at morinfr dot org
                CC: ian at airs dot com
  Target Milestone: ---

Created attachment 9531
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9531&action=edit
readelf -S output

This assertion triggers when linking objects that were created with clang
3.8.0. I can reproduce this with the current git master

The cause of the assertion is that the section_info vector contains twice the
same exact reloc (Note that I have modified the code to call abort in
do_gold_unreachable to simplify debugging)

(gdb) bt
#0  0x00007ffff7561067 in __GI_raise (address@hidden) at
../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff7562448 in __GI_abort () at abort.c:89
#2  0x00000000006c1bd4 in gold::do_gold_unreachable (filename=0x99f9f5
"icf.cc", lineno=467, 
    function=0x99fba0 <gold::get_section_contents(bool,
std::pair<gold::Relobj*, unsigned int> const&, unsigned int, unsigned int*,
gold::Symbol_table*, std::vector<unsigned int, std::allocator<unsigned int> >
const&, std::vector<std::string, std::allocator<std::string> >*)::__FUNCTION__>
"get_section_contents") at gold.cc:102
#3  0x00000000006c7baf in gold::get_section_contents (first_iteration=true,
secn=..., section_num=1141, num_tracked_relocs=0x7fffffff6498,
symtab=0x7fffffff6ef0, kept_section_id=..., section_contents=0x7fffffff6660) at
icf.cc:467
#4  0x00000000006c8252 in gold::match_sections (iteration_num=1,
symtab=0x7fffffff6ef0, num_tracked_relocs=0x7fffffff6680,
kept_section_id=0x7fffffff6e68, id_section=...,
is_secn_or_group_unique=0x7fffffff65f0, section_contents=0x7fffffff6660)
    at icf.cc:624
#5  0x00000000006c8d81 in gold::Icf::find_identical_sections
(this=0x7fffffff6e20, input_objects=0x7fffffff6d00, symtab=0x7fffffff6ef0) at
icf.cc:783
#6  0x00000000006c2ef7 in gold::queue_middle_tasks (options=..., task=0xea3230,
input_objects=0x7fffffff6d00, symtab=0x7fffffff6ef0, layout=0x7fffffff7170,
workqueue=0x7fffffff6be0, mapfile=0x0) at gold.cc:526
#7  0x00000000006c1c25 in gold::Middle_runner::run (this=0xea31f0,
workqueue=0x7fffffff6be0, task=0xea3230) at gold.cc:135
#8  0x00000000006c48af in gold::Task_function::run (this=0xea3230,
workqueue=0x7fffffff6be0) at workqueue.h:178
#9  0x000000000084f2d9 in gold::Workqueue::find_and_run_task
(this=0x7fffffff6be0, thread_number=0) at workqueue.cc:319
#10 0x000000000084f8de in gold::Workqueue::process (this=0x7fffffff6be0,
thread_number=0) at workqueue.cc:495
#11 0x0000000000406e06 in main (argc=121, argv=0x7fffffffd728) at main.cc:252
(gdb) frame 3
#3  0x00000000006c7baf in gold::get_section_contents (first_iteration=true,
secn=..., section_num=1141, num_tracked_relocs=0x7fffffff6498,
symtab=0x7fffffff6ef0, kept_section_id=..., section_contents=0x7fffffff6660) at
icf.cc:467
467                       gold_assert (offset < (long long) secn_len);
(gdb) print v
$1 = (gold::Icf::Sections_reachable_info &) @0x6d71c70:
{<std::_Vector_base<std::pair<gold::Relobj*, unsigned int>,
std::allocator<std::pair<gold::Relobj*, unsigned int> > >> = {
    _M_impl = {<std::allocator<std::pair<gold::Relobj*, unsigned int> >> =
{<__gnu_cxx::new_allocator<std::pair<gold::Relobj*, unsigned int> >> = {<No
data fields>}, <No data fields>}, _M_start = 0x6d718a0, _M_finish = 0x6d718c0, 
      _M_end_of_storage = 0x6d718c0}}, <No data fields>}
(gdb) print *(v->_M_impl->_M_start)
$2 = {first = 0x13cba80, second = 2105}
(gdb) print *(v->_M_impl->_M_start+1)
$3 = {first = 0x13cba80, second = 2105}

I am attaching the full readelf -S output for the .o

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]