<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 30, 2018 at 11:46 AM Greg Clayton <<a href="mailto:clayborg@gmail.com">clayborg@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><br><blockquote type="cite"><div>On Apr 30, 2018, at 11:41 AM, Jonas Devlieghere <<a href="mailto:jdevlieghere@apple.com" target="_blank">jdevlieghere@apple.com</a>> wrote:</div><br class="m_-8497800645187476353Apple-interchange-newline"><div><div style="word-wrap:break-word;line-break:after-white-space"><br><div><br><blockquote type="cite"><div>On Apr 30, 2018, at 6:28 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:</div><br class="m_-8497800645187476353Apple-interchange-newline"><div><div dir="ltr">Sorry - could we revisit this?<br></div></div></blockquote><div><br></div><div>Of course :-) </div><div><br></div><blockquote type="cite"><div><div dir="ltr"><br>I think my concerns expressed still haven't been resolved:<br><br>"<span style="color:rgb(33,33,33)">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)</span></div></div></blockquote><div><br></div><div>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. </div><div><br></div><div>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.</div></div></div></div></blockquote><div><br></div></div></div><div style="word-wrap:break-word;line-break:after-white-space"><div>I indeed did see a DIE that had a DW_AT_specification and pointed to another die that also had a DW_AT_specification. Regardless of what the DWARF spec says, compilers or post production DWARF tools are are producing DWARF that has these multiple chaining of specifications or abstract origins. There is also no enforcement of the DWARF spec anywhere, so compilers produce a wide variety of different DWARF that may or may not be legal. We have "llvm-dwarfdump --verify" but it isn't exhaustive in what it reports. So I would vote that we have a DWARF parser that can handle what ever is thrown at it when possible. Just my 2 cents.</div></div></blockquote><div><br>I'm not suggesting the DWARF parser should crash or be unhelpful on such inputs - but the convenience of following abstract origin/specification DIE references to print names seems OK if it's limited to the situations we know make sense until we see something else?<br><br>So if we could see/figure out what producer is generating such DWARF and look an some examples, decide if it's meaningful/useful to support name printing in that case, I'd be all for it. Without that, I'd rather err on the side of simplicity and not support the recursive case (& then have to handle/defend against cycles, etc).<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><br></div><div>Greg</div></div><div style="word-wrap:break-word;line-break:after-white-space"><div><br><blockquote type="cite"><div><div style="word-wrap:break-word;line-break:after-white-space"><div><div><br></div><div>Cheers,</div><div>Jonas </div><div><br></div><blockquote type="cite"><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Apr 30, 2018 at 10:06 AM Jonas Devlieghere via Phabricator <<a href="mailto:reviews@reviews.llvm.org" target="_blank">reviews@reviews.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This revision was automatically updated to reflect the committed changes.<br>
Closed by commit rL331200: [DebugInfo] Prevent infinite recursion for malformed DWARF (authored by JDevlieghere, committed by ).<br>
<br>
Changed prior to commit:<br>
  <a href="https://reviews.llvm.org/D43092?vs=144485&id=144582#toc" rel="noreferrer" target="_blank">https://reviews.llvm.org/D43092?vs=144485&id=144582#toc</a><br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="https://reviews.llvm.org/D43092" rel="noreferrer" target="_blank">https://reviews.llvm.org/D43092</a><br>
<br>
Files:<br>
  llvm/trunk/lib/DebugInfo/DWARF/DWARFDie.cpp<br>
  llvm/trunk/test/tools/llvm-dwarfdump/X86/invalid_abstract_origin.s<br>
<br>
</blockquote></div>
</div></blockquote></div><br></div></div></blockquote></div><br></div></blockquote></div></div>