[PATCH] D43092: [DebugInfo] Prevent infinite recursion for malformed DWARF

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 30 11:41:26 PDT 2018



> On Apr 30, 2018, at 6:28 PM, David Blaikie <dblaikie at gmail.com> wrote:
> 
> Sorry - could we revisit this?

Of course :-) 

> 
> I think my concerns expressed still haven't been resolved:
> 
> "Could you check the revision history here? I'm pretty sure the first version of this I reviewed from Greg wasn't recursive - and then it became recursive at some point to handle something needed, but maybe those decisions need to be reexamined?" (& related comments back there)

Greg added the recursiveness in D40156 because he saw DWARFDie::getName() failing “in the wild”. I think it was for some Google project but I’d have to double check the mail thread. 

IIRC we all agreed that for “valid” DWARF we shouldn’t need the recursion. The question is whether we want to support the “invalid case or not, as it’s definitely being generated (but maybe not by clang?). If the answer is yes, then r331200 is strictly better than what we had before. Now we don’t crash if there’s a cycle. If the answer is no, we just need to go back to the non-recursive implementation. Personally I don’t have a strong opinion, as long as we don’t crash.

Cheers,
Jonas 

> 
> On Mon, Apr 30, 2018 at 10:06 AM Jonas Devlieghere via Phabricator <reviews at reviews.llvm.org <mailto:reviews at reviews.llvm.org>> wrote:
> This revision was automatically updated to reflect the committed changes.
> Closed by commit rL331200: [DebugInfo] Prevent infinite recursion for malformed DWARF (authored by JDevlieghere, committed by ).
> 
> Changed prior to commit:
>   https://reviews.llvm.org/D43092?vs=144485&id=144582#toc <https://reviews.llvm.org/D43092?vs=144485&id=144582#toc>
> 
> Repository:
>   rL LLVM
> 
> https://reviews.llvm.org/D43092 <https://reviews.llvm.org/D43092>
> 
> Files:
>   llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp
>   llvm/trunk/test/tools/llvm-dwarfdump/X86/invalid_abstract_origin.s
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180430/7477ff50/attachment.html>


More information about the llvm-commits mailing list