http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54572
--- Comment #15 from Janne Blomqvist <jb at gcc dot gnu.org> 2012-12-01
19:48:12 UTC ---
(In reply to comment #14)
> Thanks for the additional info.
>
> #1 0x00007ffff7bb53be in build_address_map (addrs=0x7fffffffc710,
> data=0x7fffffffcf1c,
> error_callback=0x7ffff7ad51f0 <error_callback>, is_bigendian=0,
> dwarf_str_size=360,
> dwarf_str=0x7ffff7ff71e3 "integer(kind=4)", dwarf_ranges_size=0,
> dwarf_ranges=0x7ffff7ff6000 <Address 0x7ffff7ff6000 out of bounds>,
> dwarf_abbrev_size=253,
> dwarf_abbrev=0x7ffff7ff708f
> "\001\021\001%\016\023\vB\v\003\016\033\016\021\001\022\001\020\006",
> dwarf_info_size=484, dwarf_info=0x7ffff7ff6eab <Address 0x7ffff7ff6eab out
> of bounds>,
> base_address=<optimized out>, state=<optimized out>) at
> ../../../trunk-git/libbacktrace/dwarf.c:1299
>
> That is weird because it is showing the parameters in reverse order. Is that
> what gdb normally does on your system? It doesn't seem to do it for other
> functions.
No, I've never seen it before. Then again, before yesterday I had never used
GDB 7.5, only older versions.
> Here gdb says that the value of dwarf_info is out of bounds. That is not
> good.
> That is most likely the immediate cause of the problem. (dwarf_ranges is
> also
> out of bounds, but that likely doesn't matter as dwarf_ranges_size is zero.)
>
> It looks like it had trouble getting the debug info for the executable file
> itself. Can you add the output of readelf -S on the executable?
$ readelf -S bt2.g
There are 35 section headers, starting at offset 0x1668:
Section Headers:
[Nr] Name Type Address Offset
Size EntSize Flags Link Info Align
[ 0] NULL 0000000000000000 00000000
0000000000000000 0000000000000000 0 0 0
[ 1] .interp PROGBITS 0000000000400200 00000200
000000000000001c 0000000000000000 A 0 0 1
[ 2] .note.ABI-tag NOTE 000000000040021c 0000021c
0000000000000020 0000000000000000 A 0 0 4
[ 3] .hash HASH 0000000000400240 00000240
0000000000000040 0000000000000004 A 4 0 8
[ 4] .dynsym DYNSYM 0000000000400280 00000280
0000000000000108 0000000000000018 A 5 1 8
[ 5] .dynstr STRTAB 0000000000400388 00000388
00000000000001c8 0000000000000000 A 0 0 1
[ 6] .gnu.version VERSYM 0000000000400550 00000550
0000000000000016 0000000000000002 A 4 0 2
[ 7] .gnu.version_r VERNEED 0000000000400568 00000568
0000000000000050 0000000000000000 A 5 2 8
[ 8] .rela.dyn RELA 00000000004005b8 000005b8
0000000000000018 0000000000000018 A 4 0 8
[ 9] .rela.plt RELA 00000000004005d0 000005d0
0000000000000090 0000000000000018 A 4 11 8
[10] .init PROGBITS 0000000000400660 00000660
000000000000000e 0000000000000000 AX 0 0 4
[11] .plt PROGBITS 0000000000400670 00000670
0000000000000070 0000000000000010 AX 0 0 16
[12] .text PROGBITS 00000000004006e0 000006e0
00000000000002f4 0000000000000000 AX 0 0 16
[13] .fini PROGBITS 00000000004009d4 000009d4
0000000000000009 0000000000000000 AX 0 0 4
[14] .rodata PROGBITS 00000000004009e0 000009e0
000000000000003c 0000000000000000 A 0 0 16
[15] .eh_frame_hdr PROGBITS 0000000000400a1c 00000a1c
000000000000004c 0000000000000000 A 0 0 4
[16] .eh_frame PROGBITS 0000000000400a68 00000a68
0000000000000124 0000000000000000 A 0 0 8
[17] .init_array INIT_ARRAY 0000000000600b90 00000b90
0000000000000008 0000000000000000 WA 0 0 8
[18] .fini_array FINI_ARRAY 0000000000600b98 00000b98
0000000000000008 0000000000000000 WA 0 0 8
[19] .jcr PROGBITS 0000000000600ba0 00000ba0
0000000000000008 0000000000000000 WA 0 0 8
[20] .dynamic DYNAMIC 0000000000600ba8 00000ba8
0000000000000220 0000000000000010 WA 5 0 8
[21] .got PROGBITS 0000000000600dc8 00000dc8
0000000000000008 0000000000000008 WA 0 0 8
[22] .got.plt PROGBITS 0000000000600dd0 00000dd0
0000000000000048 0000000000000008 WA 0 0 8
[23] .data PROGBITS 0000000000600e18 00000e18
0000000000000010 0000000000000000 WA 0 0 8
[24] .bss NOBITS 0000000000600e28 00000e28
0000000000000008 0000000000000000 WA 0 0 4
[25] .comment PROGBITS 0000000000000000 00000e28
0000000000000053 0000000000000001 MS 0 0 1
[26] .debug_aranges PROGBITS 0000000000000000 00000e7b
0000000000000030 0000000000000000 0 0 1
[27] .debug_info PROGBITS 0000000000000000 00000eab
00000000000001e4 0000000000000000 0 0 1
[28] .debug_abbrev PROGBITS 0000000000000000 0000108f
00000000000000fd 0000000000000000 0 0 1
[29] .debug_line PROGBITS 0000000000000000 0000118c
0000000000000057 0000000000000000 0 0 1
[30] .debug_str PROGBITS 0000000000000000 000011e3
0000000000000168 0000000000000001 MS 0 0 1
[31] .debug_loc PROGBITS 0000000000000000 0000134b
00000000000001e0 0000000000000000 0 0 1
[32] .shstrtab STRTAB 0000000000000000 0000152b
000000000000013c 0000000000000000 0 0 1
[33] .symtab SYMTAB 0000000000000000 00001f28
0000000000000768 0000000000000018 34 52 8
[34] .strtab STRTAB 0000000000000000 00002690
000000000000032d 0000000000000000 0 0 1
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings), l (large)
I (info), L (link order), G (group), T (TLS), E (exclude), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
Like I mentioned previously, my binutils is version 2.22 which apparently
doesn't have complete support for DWARF-4. I can certainly try upgrading, if
you think that would help; I don't really know what to look for in the above
output, sorry.