<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Sat, Nov 3, 2018 at 6:51 AM Muhui Jiang via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr">Hi <div><br></div><div>I come across the following exception when I use the llvm-dwarfdump -debug-info target_binary: </div><div><br></div><div>llvm-dwarfdump: /home/linux/llvm-7/llvm/lib/MC/MCRegisterInfo.cpp:87: int llvm::MCRegisterInfo::getLLVMRegNum(unsigned int, bool) const: Assertion `I != M+Size && I->FromReg == RegNum && "Invalid RegNum"' failed.</div><div>Stack dump:</div><div>0.      Program arguments: /home/linux/llvm-7/llvm/build/bin/llvm-dwarfdump -debug-info C++/483.xalancbmk.O1</div><div>#0 0x000000000093ab37 llvm::sys::PrintStackTrace(llvm::raw_ostream&) /home/linux/llvm-7/llvm/lib/Support/Unix/Signals.inc:490:0</div><div>#1 0x000000000093abca PrintStackTraceSignalHandler(void*) /home/linux/llvm-7/llvm/lib/Support/Unix/Signals.inc:554:0</div><div>#2 0x00000000009388d8 llvm::sys::RunSignalHandlers() /home/linux/llvm-7/llvm/lib/Support/Signals.cpp:67:0</div><div>#3 0x000000000093a531 SignalHandler(int) /home/linux/llvm-7/llvm/lib/Support/Unix/Signals.inc:353:0</div><div>#4 0x00007f39f47d7390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)</div><div>#5 0x00007f39f374d428 gsignal /build/glibc-Cl5G7W/glibc-2.23/signal/../sysdeps/unix/sysv/linux/raise.c:54:0</div><div>#6 0x00007f39f374f02a abort /build/glibc-Cl5G7W/glibc-2.23/stdlib/abort.c:91:0</div><div>#7 0x00007f39f3745bd7 __assert_fail_base /build/glibc-Cl5G7W/glibc-2.23/assert/assert.c:92:0</div><div>#8 0x00007f39f3745c82 (/lib/x86_64-linux-gnu/libc.so.6+0x2dc82)</div><div>#9 0x00000000006e6ba1 llvm::MCRegisterInfo::getLLVMRegNum(unsigned int, bool) const /home/linux/llvm-7/llvm/lib/MC/MCRegisterInfo.cpp:88:0</div><div>#10 0x00000000004bd03e llvm::prettyPrintRegisterOp(llvm::raw_ostream&, unsigned char, unsigned long*, llvm::MCRegisterInfo const*, bool) /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp:206:0</div><div>#11 0x00000000004bd226 llvm::DWARFExpression::Operation::print(llvm::raw_ostream&, llvm::DWARFExpression const*, llvm::MCRegisterInfo const*, bool) /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp:237:0</div><div>#12 0x00000000004bd466 llvm::DWARFExpression::print(llvm::raw_ostream&, llvm::MCRegisterInfo const*, bool) const /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFExpression.cpp:264:0</div><div>#13 0x00000000004a8c68 dumpExpression(llvm::raw_ostream&, llvm::ArrayRef<char>, bool, unsigned int, llvm::MCRegisterInfo const*) /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp:38:0</div><div>#14 0x00000000004a8ea5 llvm::DWARFDebugLoc::LocationList::dump(llvm::raw_ostream&, bool, unsigned int, llvm::MCRegisterInfo const*, unsigned long, unsigned int) const /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFDebugLoc.cpp:45:0</div><div>#15 0x00000000004b331d dumpLocation(llvm::raw_ostream&, llvm::DWARFFormValue&, llvm::DWARFUnit*, unsigned int, llvm::DIDumpOptions) /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp:115:0</div><div>#16 0x00000000004b4034 dumpAttribute(llvm::raw_ostream&, llvm::DWARFDie const&, unsigned int*, llvm::dwarf::Attribute, llvm::dwarf::Form, unsigned int, llvm::DIDumpOptions) /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp:243:0</div><div>#17 0x00000000004b5cd2 llvm::DWARFDie::dump(llvm::raw_ostream&, unsigned int, llvm::DIDumpOptions) const /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp:521:0</div><div>#18 0x00000000004b5db4 llvm::DWARFDie::dump(llvm::raw_ostream&, unsigned int, llvm::DIDumpOptions) const /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp:530:0</div><div>#19 0x00000000004b5db4 llvm::DWARFDie::dump(llvm::raw_ostream&, unsigned int, llvm::DIDumpOptions) const /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp:530:0</div><div>#20 0x00000000004b5db4 llvm::DWARFDie::dump(llvm::raw_ostream&, unsigned int, llvm::DIDumpOptions) const /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp:530:0</div><div>#21 0x0000000000445cdd llvm::DWARFCompileUnit::dump(llvm::raw_ostream&, llvm::DIDumpOptions) /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFCompileUnit.cpp:31:0</div><div>#22 0x00000000004482ad llvm::DWARFContext::dump(llvm::raw_ostream&, llvm::DIDumpOptions, std::array<llvm::Optional<unsigned long>, 27ul>)::'lambda0'(bool, char const*, llvm::DWARFSection, llvm::iterator_range<std::unique_ptr<llvm::DWARFCompileUnit, std::default_delete<llvm::DWARFCompileUnit> >*>)::operator()(bool, char const*, llvm::DWARFSection, llvm::iterator_range<std::unique_ptr<llvm::DWARFCompileUnit, std::default_delete<llvm::DWARFCompileUnit> >*>) const /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:351:0</div><div>#23 0x0000000000448e28 llvm::DWARFContext::dump(llvm::raw_ostream&, llvm::DIDumpOptions, std::array<llvm::Optional<unsigned long>, 27ul>) /home/linux/llvm-7/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp:355:0</div><div>#24 0x0000000000414af6 dumpObjectFile(llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine, llvm::raw_ostream&) /home/linux/llvm-7/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:424:0</div><div>#25 0x0000000000425d9a std::_Function_handler<bool (llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine, llvm::raw_ostream&), bool (*)(llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine, llvm::raw_ostream&)>::_M_invoke(std::_Any_data const&, llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine&&, llvm::raw_ostream&) /usr/include/c++/5/functional:1857:0</div><div>#26 0x0000000000420f69 std::function<bool (llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine, llvm::raw_ostream&)>::operator()(llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine, llvm::raw_ostream&) const /usr/include/c++/5/functional:2268:0</div><div>#27 0x0000000000415377 handleBuffer(llvm::StringRef, llvm::MemoryBufferRef, std::function<bool (llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine, llvm::raw_ostream&)>, llvm::raw_ostream&) /home/linux/llvm-7/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:472:0</div><div>#28 0x0000000000415ae2 handleFile(llvm::StringRef, std::function<bool (llvm::object::ObjectFile&, llvm::DWARFContext&, llvm::Twine, llvm::raw_ostream&)>, llvm::raw_ostream&) /home/linux/llvm-7/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:506:0</div><div>#29 0x00000000004170a4 main /home/linux/llvm-7/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:623:0</div><div>#30 0x00007f39f3738830 __libc_start_main /build/glibc-Cl5G7W/glibc-2.23/csu/../csu/libc-start.c:325:0</div><div>#31 0x00000000004092e9 _start (/home/linux/llvm-7/llvm/build/bin/llvm-dwarfdump+0x4092e9)</div><div>Aborted (core dumped)</div><div> <br></div><div><br></div><div><div>After the google search. It seems that it should be an bug here <a href="https://www.mail-archive.com/llvm-bugs@lists.llvm.org/msg21648.html" target="_blank">https://www.mail-archive.com/llvm-bugs@lists.llvm.org/msg21648.html</a></div><div><br></div><div>I am using llvm 7.0 and cross compiled the binary with linaro arm toolchain(7.3.1). It takes me quiet a long time to compile and analysis the bitcode. Are there any solutions on fixing this without re-compiling the binary. Many Thanks</div></div></div></div></blockquote><div><br>Not much you can do to fix the bug if you can't readily recompile and rerun the tests - what sort of hardware do you have access to? (you might be able to reproduce this without ARM if your ARM machine has few cores/not much RAM but you have something else (X86 desktop machine) with more of both)<br><br>If you can't do that but would like to help move the bug forward anyway, a useful thing to do might be to try to find a reduced/small test case that demonstrates the issue to make it easier for someone else to investigate and fix the issue.<br><br>- Dave<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div><div><br></div><div>Regards</div></div><div>Muhui</div></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>