[llvm-bugs] [Bug 51684] New: assertion failure in llvm-objdump for thinLTO x86_64 linux kernel

via llvm-bugs llvm-bugs at lists.llvm.org
Mon Aug 30 16:19:56 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51684

            Bug ID: 51684
           Summary: assertion failure in llvm-objdump for thinLTO x86_64
                    linux kernel
           Product: tools
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: llvm-objdump
          Assignee: unassignedbugs at nondot.org
          Reporter: ndesaulniers at google.com
                CC: jh7370.2008 at my.bristol.ac.uk,
                    llvm-bugs at lists.llvm.org, maskray at google.com
            Blocks: 4068, 51236

I've got a disassembler assertion failure when disassembling a Linux kernel
built with thinLTO that bisects back to https://reviews.llvm.org/D102296.

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 https://bugs.llvm.org/ 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
https://lore.kernel.org/lkml/5913cdf4-9c8e-38f8-8914-d3b8a3565d73@kernel.org/.


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=4068
[Bug 4068] [Meta] Compiling the Linux kernel with clang
https://bugs.llvm.org/show_bug.cgi?id=51236
[Bug 51236] [meta] 13.0.0 Release Blockers
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210830/9214794f/attachment.html>


More information about the llvm-bugs mailing list