Yeah, when I was studying ELF format I used gdb to inspect hand-crafted ELF files to better understand what actual semantics some fields actually have (or how they're supposed to validated) and I was quite surprised when it would segfault on disassembly attempt — not the program under inspection but the gdb itself. IMHO for a debugger to segfault when attempting to inspect the program under it because the program has wrong headers/corrupted memory layout or whatever is completely inexcusable: the reason you attach debugger to a program is generally because it went (spectacularly) spoiled and curdled and now you try to figure out what the hell happened.