This libbacktrace patch fixes the ELF support so that after reading symbol information we don't free the strtab, even if we encounter an error later while reading debug info. This fixes programs that try to get symbol information even if they can't get backtrace information. Bootstrapped and ran libbacktrace tests on x86_64-pc-linux-gnu. Committed to mainline.
Ian 2020-05-09 Ian Lance Taylor <i...@golang.org> * elf.c (elf_add): Don't free strtab if an error occurs after recording symbol information.
index eb481c588e7..1216af86fd9 100644 --- a/libbacktrace/elf.c +++ b/libbacktrace/elf.c @@ -3011,6 +3011,7 @@ elf_add (struct backtrace_state *state, const char *filename, int descriptor, string table permanently. */ backtrace_release_view (state, &symtab_view, error_callback, data); symtab_view_valid = 0; + strtab_view_valid = 0; *found_sym = 1;