<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/62716>62716</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [debuginfo-analyzer] Assertion failed: (!Element || isa<LVSymbol>(Element)) && "Invalid element"
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            debuginfo
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          omern1
      </td>
    </tr>
</table>

<pre>
    Debuginfo-analyzer fails with the following assertion:

```
🎈 ./bin/llvm-debuginfo-analyzer --print=symbols ./bin/llvm-tblgen                                                                                                                                                                                                                                                                   9:59:50 | 0
llvm-debuginfo-analyzer: /llvm-project/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h:102: virtual void llvm::logicalview::LVSymbol::setReference(llvm::logicalview::LVElement *): Assertion `(!Element || isa<LVSymbol>(Element)) && "Invalid element"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: ./bin/llvm-debuginfo-analyzer --print=symbols ./bin/llvm-tblgen
 #0 0x0000558b29173cbd llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /llvm-project/llvm/lib/Support/Unix/Signals.inc:602:11
 #1 0x0000558b2917413b PrintStackTraceSignalHandler(void*) /llvm-project/llvm/lib/Support/Unix/Signals.inc:675:1
 #2 0x0000558b29172416 llvm::sys::RunSignalHandlers() /llvm-project/llvm/lib/Support/Signals.cpp:104:5
 #3 0x0000558b291748f5 SignalHandler(int) /llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007f476a23c4b0 (/lib/x86_64-linux-gnu/libc.so.6+0x3c4b0)
 #5 0x00007f476a290ffb __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x00007f476a290ffb __pthread_kill_internal ./nptl/pthread_kill.c:78:10
 #7 0x00007f476a290ffb pthread_kill ./nptl/pthread_kill.c:89:10
 #8 0x00007f476a23c406 raise ./signal/../sysdeps/posix/raise.c:27:6
 #9 0x00007f476a22287c abort ./stdlib/abort.c:81:7
#10 0x00007f476a22279b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#11 0x00007f476a233b86 (/lib/x86_64-linux-gnu/libc.so.6+0x33b86)
#12 0x0000558b28c03bdf llvm::logicalview::LVSymbol::setReference(llvm::logicalview::LVElement*) /llvm-project/llvm/include/llvm/DebugInfo/LogicalView/Core/LVSymbol.h:0:5
#13 0x0000558b28ca2018 llvm::logicalview::LVELFReader::processOneDie(llvm::DWARFDie const&, llvm::logicalview::LVScope*, llvm::DWARFDie&) /llvm-project/llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp:563:9
#14 0x0000558b28ca2821 llvm::logicalview::LVELFReader::traverseDieAndChildren(llvm::DWARFDie&, llvm::logicalview::LVScope*, llvm::DWARFDie&) /llvm-project/llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp:682:12
#15 0x0000558b28ca2894 llvm::logicalview::LVELFReader::traverseDieAndChildren(llvm::DWARFDie&, llvm::logicalview::LVScope*, llvm::DWARFDie&) /llvm-project/llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp:691:21
#16 0x0000558b28ca3979 llvm::logicalview::LVELFReader::createScopes() /llvm-project/llvm/lib/DebugInfo/LogicalView/Readers/LVELFReader.cpp:944:30
#17 0x0000558b28bb7ab8 llvm::logicalview::LVReader::doLoad() /llvm-project/llvm/lib/DebugInfo/LogicalView/Core/LVReader.cpp:236:19
#18 0x0000558b28c0a232 llvm::logicalview::LVReaderHandler::createReader(llvm::StringRef, std::vector<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>, std::allocator<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>>>&, llvm::PointerUnion<llvm::object::ObjectFile*, llvm::pdb::PDBFile*>&, llvm::StringRef, llvm::StringRef) /llvm-project/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp:70:18
#19 0x0000558b28c0c03a llvm::logicalview::LVReaderHandler::handleObject(std::vector<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>, std::allocator<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>>>&, llvm::StringRef, llvm::object::Binary&) /llvm-project/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp:245:5
#20 0x0000558b28c0b53b llvm::logicalview::LVReaderHandler::handleBuffer(std::vector<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>, std::allocator<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>>>&, llvm::StringRef, llvm::MemoryBufferRef, llvm::StringRef) /llvm-project/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp:196:10
#21 0x0000558b28c0bef0 llvm::logicalview::LVReaderHandler::handleFile(std::vector<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>, std::allocator<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>>>&, llvm::StringRef, llvm::StringRef) /llvm-project/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp:212:10
#22 0x0000558b28c0dc50 llvm::logicalview::LVReaderHandler::createReader(llvm::StringRef, std::vector<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>, std::allocator<std::unique_ptr<llvm::logicalview::LVReader, std::default_delete<llvm::logicalview::LVReader>>>>&) /llvm-project/llvm/include/llvm/DebugInfo/LogicalView/LVReaderHandler.h:78:12
#23 0x0000558b28c09bc9 llvm::logicalview::LVReaderHandler::createReaders() /llvm-project/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp:280:21
#24 0x0000558b28c0997c llvm::logicalview::LVReaderHandler::process() /llvm-project/llvm/lib/DebugInfo/LogicalView/LVReaderHandler.cpp:30:19
#25 0x0000558b283d6765 main /llvm-project/llvm/tools/llvm-debuginfo-analyzer/llvm-debuginfo-analyzer.cpp:137:13
#26 0x00007f476a223a90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#27 0x00007f476a223b49 call_init ./csu/../csu/libc-start.c:128:20
#28 0x00007f476a223b49 __libc_start_main ./csu/../csu/libc-start.c:347:5
#29 0x0000558b283d6205 _start (./bin/llvm-debuginfo-analyzer+0x1bef205)
zsh: IOT instruction (core dumped)  ./bin/llvm-debuginfo-analyzer --print=symbols ./bin/llvm-tblgen
```

This issue was discovered twice independently in https://reviews.llvm.org/D147270 and with an internal binary.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWVtv6yoa_TXkBTXC4OtDHtKm0Wypo73V7nPmMcKAE2YTyADu5fz6ETiJEze97bajI02rKoqJWaxvsbh-1Dm51EJMQHYOstmItn5l7MSshdXJqDb8YTITdbuUujFnVFP18JewsKFSOXgn_Qr6lYCNUcrcSb2E1DlhvTQakClAM4B2nzna_nePcwSqOSgvQVnCMcDzWmqA50rdrs_44-bOzjZWag_IzD2sa6PcsI6v1VJo-PVXATLN4geCoLiAW72fEBaQKdxJuLHm34L57SPAc6mZarnoC6IPvunGADy_MkvJqPpTijuA5xfGhveu_ryJ3TNeATJNEA7wt9L6lip4aySHEYhMAZmqrv5tqB8LdnW7Jyf8tWiEFZoJgMtn610qsRbaQ4CnAIfQ4XRnQhgMh0uAk_1LxUWQRToKyEXf5iXA5faVgIErCHAOcA4Bxt_0LVWSQ7H7HQNcxBEg-LiT98fV5fTmErq2XksPKazbJbRiY6yH3sCV9xsX2OI5wPOl9Ku2HjOz7pUddIB0rhUO4DmkmsNtP8SBxix1K1hT9stbysS2-RtP2S_I2_VmP-rQuPPDD2uWlq4htcs2sA88Pm7AdW1BgAmC6B4hhLKsrHGVFITVh93tHlz35UeAjXx_hgCO-tbSu4Vx3gq6j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