http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56076
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-24 09:47:00 UTC --- I guess if DW_AT_comp_dir attribute is missing, we could crash that way. We could do: --- libbacktrace/dwarf.c.jj 2013-01-17 13:42:51.000000000 +0100 +++ libbacktrace/dwarf.c 2013-01-24 10:43:38.234973942 +0100 @@ -1655,7 +1655,8 @@ read_line_header (struct backtrace_state strnlen ((const char *) hdr_buf.buf, hdr_buf.left) + 1)) return 0; dir_index = read_uleb128 (&hdr_buf); - if (IS_ABSOLUTE_PATH (filename)) + if (IS_ABSOLUTE_PATH (filename) + || (dir_index == 0 && u->comp_dir == NULL)) hdr->filenames[i] = filename; else { or perhaps issue an error if dir_index == 0 && u->comp_dir == NULL inside of else. But I believe even some GCC versions in the past were buggy and didn't emit DW_AT_comp_dir always when needed, and other compilers could have similar bugs too, so perhaps we should be more forgiving.