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

Simon Marchi
2020-06-15T14:58:08Z

On 2020-06-14 1:07 p.m., watashiwaher wrote:
> It is a shame. But it seems I can't. Also I am not so strong in dwarf2.
> The binary was so huge and so private, that I was so dumb to understand what actually inside binary got wrong :(
> All I just noticed, it is that get_builder() calls itself recursively, in such manner:
> ptr1 -> ptr2 -> ptr1 -> ptr2 -> ...
> And tho I made a small patch that:
> 1) eliminate recursion
> 2) uses tortoise algorithm to break out of loop
> All I can say, that I really had a halt in this function due to the recursion, because I debugged that halt in GDB...

Could you at least provide a backtrace of GDB in this endless loop? Then we
can maybe understand what got it that way and build a reproducer from that.

Simon