bug-binutils
[Top][All Lists]
Advanced

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

[Bug binutils/22192] New: float point exception in decode_line_info in b


From: luanjunchao at 163 dot com
Subject: [Bug binutils/22192] New: float point exception in decode_line_info in binutils 2.29 dwarf2.c
Date: Sat, 23 Sep 2017 08:52:21 +0000

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

            Bug ID: 22192
           Summary: float point exception in decode_line_info in binutils
                    2.29 dwarf2.c
           Product: binutils
           Version: 2.29
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: luanjunchao at 163 dot com
  Target Milestone: ---

Created attachment 10464
  --> https://sourceware.org/bugzilla/attachment.cgi?id=10464&action=edit
floating point exception poc

The result of gdb debugging "objdump -x -SD -Wl -R crash_float.elf " is as
follows:

....
Program received signal SIGFPE, Arithmetic exception.
0x00000000007861e5 in decode_line_info (unit=0xd6f980,
address@hidden) at ./dwarf2.c:2440
2440                    address += (lh.minimum_instruction_length
(gdb) bt
#0  0x00000000007861e5 in decode_line_info (unit=0xd6f980,
address@hidden) at ./dwarf2.c:2440
#1  0x000000000079ad3c in comp_unit_find_nearest_line (unit=0xd6f980,
addr=4198724, filename_ptr=0x7fffffffdec8, function_ptr=0x7fffffffded0,
linenumber_ptr=0x7fffffffdeb8, discriminator_ptr=0x7fffffffdebc,
stash=0xd69270) at ./dwarf2.c:3562
#2  0x00000000007a44f5 in _bfd_dwarf2_find_nearest_line
(address@hidden, address@hidden,
address@hidden, address@hidden, address@hidden,
address@hidden, 
    functionname_ptr=0x7fffffffe0b8, linenumber_ptr=0x7fffffffe0a4,
discriminator_ptr=0x7fffffffe0a8, debug_sections=0xb03840
<dwarf_debug_sections>, addr_size=0, pinfo=0xd60620) at ./dwarf2.c:4622
#3  0x00000000006c286e in _bfd_elf_find_nearest_line (abfd=0xd601c0,
symbols=0xd69c40, section=0xd655e8, offset=0, filename_ptr=0x7fffffffe0b0,
functionname_ptr=0x7fffffffe0b8, line_ptr=0x7fffffffe0a4,
discriminator_ptr=0x7fffffffe0a8) at elf.c:8653
#4  0x0000000000422f41 in show_line (addr_offset=0, section=<optimized out>,
abfd=0xd601c0) at ./objdump.c:1486
#5  disassemble_bytes (address@hidden, disassemble_fn=0x59c380
<print_insn_i386>, address@hidden, data=<optimized out>,
address@hidden, address@hidden,
rel_offset=4198724, relppp=0x7fffffffe278, relppend=0xd6c720)
    at ./objdump.c:1791
#6  0x000000000042ddfe in disassemble_section (abfd=0xd601c0,
section=<optimized out>, inf=0x7fffffffe360) at ./objdump.c:2313
#7  0x00000000005f390c in bfd_map_over_sections (address@hidden,
address@hidden <disassemble_section>,
address@hidden) at section.c:1395
#8  0x00000000004165a0 in disassemble_data (address@hidden) at
./objdump.c:2449
#9  0x000000000041c620 in dump_bfd (address@hidden) at
./objdump.c:3546
#10 0x000000000041e0f0 in display_object_bfd (abfd=0xd601c0) at
./objdump.c:3603
#11 display_any_bfd (address@hidden, address@hidden) at
./objdump.c:3692
#12 0x000000000040c75e in display_file (last_file=1, target=<optimized out>,
filename=0x7fffffffe8aa "crash_float.elf") at ./objdump.c:3713
#13 main (argc=6, argv=0x7fffffffe658) at ./objdump.c:4015
(gdb) list
2435                  break;
2436                case DW_LNS_set_basic_block:
2437                  break;
2438                case DW_LNS_const_add_pc:
2439                  if (lh.maximum_ops_per_insn == 1)
2440                    address += (lh.minimum_instruction_length
2441                                * ((255 - lh.opcode_base) /
lh.line_range));
2442                  else
2443                    {
2444                      bfd_vma adjust = ((255 - lh.opcode_base) /
lh.line_range);
(gdb) x/i $rip
=> 0x7861e5 <decode_line_info+14101>:   idivl  0x78(%rsp)
(gdb) x/xw $rsp+0x78
0x7fffffffdcd8: 0x00000000


We can see clearly that lh.line_range =0 resulting the floating point
exception.

-- 
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]