Re: [PATCH] Fixing get_builder() function in dwarf2/read.c

Simon Marchi
2020-06-14T16:58:14Z

On 2020-06-14 12:49 p.m., watashiwaher via Gdb-patches wrote:
> Explanation
> I found that some binaries with debug symbols halt gdb. And the problem was
> in the get_builder() function inside dwarf2/read.c file. The function
> recursively called itself until infinity. So I tried to fix this issue by
> eliminating recursion and adding the check for cycle detection, and
> returning nullptr if cycle detected.
>
> ChangeLog
> 2020-06-15 Slava Mitin <watashiwaher@gmail.com>
>
> * dwarf2/read.c (get_builder): Added check for cycles

Hi!

Thanks for the patch. We try very hard to have a test case checked in for each
fix like this. Would you be able to share a small reproducer (a small program
that makes GDB crash like this) that we could turn into a test case?

Simon