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

Simon Marchi simark@simark.ca
Mon Jun 15 14:58:06 GMT 2020


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


More information about the Gdb-patches mailing list