<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - assertion failure in llvm-objdump for thinLTO x86_64 linux kernel"
href="https://bugs.llvm.org/show_bug.cgi?id=51684">51684</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>assertion failure in llvm-objdump for thinLTO x86_64 linux kernel
</td>
</tr>
<tr>
<th>Product</th>
<td>tools
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>llvm-objdump
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ndesaulniers@google.com
</td>
</tr>
<tr>
<th>CC</th>
<td>jh7370.2008@my.bristol.ac.uk, llvm-bugs@lists.llvm.org, maskray@google.com
</td>
</tr>
<tr>
<th>Blocks</th>
<td>4068, 51236
</td>
</tr></table>
<p>
<div>
<pre>I've got a disassembler assertion failure when disassembling a Linux kernel
built with thinLTO that bisects back to <a href="https://reviews.llvm.org/D102296">https://reviews.llvm.org/D102296</a>.
llvm-objdump: ../include/llvm/ADT/ArrayRef.h:196: ArrayRef<T>
llvm::ArrayRef<unsigned char>::slice(size_t, size_t) const [T = unsigned char]:
Assertion `N+M <= size() && "Invalid specifier"' failed.
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace.
Stack dump:
0. Program arguments: llvm-objdump -dr vmlinux
#0 0x00000000016f4b7a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/android0/llvm-project/llvm/build/../lib/Support/Unix/Signals.inc:565:11
#1 0x00000000016f4d2b PrintStackTraceSignalHandler(void*)
/android0/llvm-project/llvm/build/../lib/Support/Unix/Signals.inc:632:1
#2 0x00000000016f33f3 llvm::sys::RunSignalHandlers()
/android0/llvm-project/llvm/build/../lib/Support/Signals.cpp:97:5
#3 0x00000000016f5455 SignalHandler(int)
/android0/llvm-project/llvm/build/../lib/Support/Unix/Signals.inc:407:1
#4 0x00007f622df59140 __restore_rt
(/lib/x86_64-linux-gnu/libpthread.so.0+0x14140)
#5 0x00007f622da31ce1 raise ./signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#6 0x00007f622da1b537 abort ./stdlib/abort.c:81:7
#7 0x00007f622da1b40f get_sysdep_segment_value ./intl/loadmsgcat.c:509:8
#8 0x00007f622da1b40f _nl_load_domain ./intl/loadmsgcat.c:970:34
#9 0x00007f622da2a662 (/lib/x86_64-linux-gnu/libc.so.6+0x34662)
#10 0x0000000000f15340 llvm::ArrayRef<unsigned char>::slice(unsigned long,
unsigned long) const
/android0/llvm-project/llvm/build/../include/llvm/ADT/ArrayRef.h:0:7
#11 0x0000000000ee9fbd disassembleObject(llvm::Target const*,
llvm::object::ObjectFile const*, llvm::MCContext&, llvm::MCDisassembler*,
llvm::MCDisassembler*, llvm::MCInstrAnalysis const*, llvm::MCInstPrinter*,
llvm::MCSubtargetInfo const*, llvm::MCSubtargetInfo const*, (anonymous
namespace)::PrettyPrinter&, llvm::objdump::SourcePrinter&, bool)
/android0/llvm-project/llvm/build/../tools/llvm-objdump/llvm-objdump.cpp:1437:51
#12 0x0000000000ee72ee disassembleObject(llvm::object::ObjectFile const*, bool)
/android0/llvm-project/llvm/build/../tools/llvm-objdump/llvm-objdump.cpp:1711:1
#13 0x0000000000ee56f0 dumpObject(llvm::object::ObjectFile*,
llvm::object::Archive const*, llvm::object::Archive::Child const*)
/android0/llvm-project/llvm/build/../tools/llvm-objdump/llvm-objdump.cpp:2352:7
#14 0x0000000000ee2dd2 dumpInput(llvm::StringRef)
/android0/llvm-project/llvm/build/../tools/llvm-objdump/llvm-objdump.cpp:2432:5
#15 0x0000000000f40a99 void
(*std::for_each<__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >*,
std::vector<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >, void
(*)(llvm::StringRef)>(__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >*,
std::vector<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >,
__gnu_cxx::__normal_iterator<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >*,
std::vector<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > >, void
(*)(llvm::StringRef)))(llvm::StringRef)
/usr/lib/gcc/x86_64-linux-gnu/10/../../../../include/c++/10/bits/stl_algo.h:3838:33
#16 0x0000000000ef4e6b void
(*llvm::for_each<std::vector<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >&, void
(*)(llvm::StringRef)>(std::vector<std::__cxx11::basic_string<char,
std::char_traits<char>, std::allocator<char> >,
std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char> > > >&, void (*)(llvm::StringRef)))(llvm::StringRef)
/android0/llvm-project/llvm/build/../include/llvm/ADT/STLExtras.h:1541:3
#17 0x0000000000ee1268 main
/android0/llvm-project/llvm/build/../tools/llvm-objdump/llvm-objdump.cpp:2708:3
#18 0x00007f622da1cd0a __libc_start_main ./csu/../csu/libc-start.c:308:16
#19 0x0000000000edcb9a _start
(/android0/llvm-project/llvm/build/bin/llvm-objdump+0xedcb9a)
[1] 2784195 abort llvm-objdump -dr vmlinux
Indeed, if I revert 8ec73e96b72d04787ed606cfbb62a7a2a05b3711, I can disassemble
my kernel again. This is blocking debugging of
<a href="https://lore.kernel.org/lkml/5913cdf4-9c8e-38f8-8914-d3b8a3565d73@kernel.org/">https://lore.kernel.org/lkml/5913cdf4-9c8e-38f8-8914-d3b8a3565d73@kernel.org/</a>.</pre>
</div>
</p>
<div id="referenced">
<hr style="border: 1px dashed #969696">
<b>Referenced Bugs:</b>
<ul>
<li>
[<a class="bz_bug_link
bz_status_CONFIRMED "
title="CONFIRMED - [Meta] Compiling the Linux kernel with clang"
href="https://bugs.llvm.org/show_bug.cgi?id=4068">Bug 4068</a>] [Meta] Compiling the Linux kernel with clang
</li>
<li>
[<a class="bz_bug_link
bz_status_NEW "
title="NEW - [meta] 13.0.0 Release Blockers"
href="https://bugs.llvm.org/show_bug.cgi?id=51236">Bug 51236</a>] [meta] 13.0.0 Release Blockers
</li>
</ul>
</div>
<br>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>