My LLVM program crashes gdb

One of my unit tests has been failing recently, and the odd thing is that when I attempt to debug it in gdb, it causes a segfault:

$ gdb test/stdlib/HashMapTest

GNU gdb (GDB) 7.0-ubuntu

Copyright (C) 2009 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 “x86_64-linux-gnu”.

For bug reporting instructions, please see:

<http://www.gnu.org/software/gdb/bugs/>…

Reading symbols from /home/talin/Projects/tart/build-eclipse/test/stdlib/HashMapTest…done.

(gdb) break main

Segmentation fault

I’m not sure whether this is LLVM’s fault or mine - and I’m not sure how to go about finding out. I’m guessing something is wrong with the DWARF debugging info.

You can print the dwarf using readelf -w or objdump -W, but
understanding the output is beyond my ability.
http://dwarfstd.org/Debugging%20using%20DWARF.pdf may describe it well
enough for you to debug it.

One of my unit tests has been failing recently, and the odd thing is that
when I attempt to debug it in gdb, it causes a segfault:

$ gdb test/stdlib/HashMapTest
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 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 "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/talin/Projects/tart/build-eclipse/test/stdlib/HashMapTest...done.
(gdb) break main
Segmentation fault

I'm not sure whether this is LLVM's fault or mine - and I'm not sure how to
go about finding out. I'm guessing something is wrong with the DWARF
debugging info.

Probably a good guess, although gdb probably shouldn't crash either.
If you file a bug against gdb, they can probably tell what is wrong.

- Daniel