[llvm-bugs] [Bug 50547] New: crash on llvm::codeview::CodeViewRecordIO::mapEncodedInteger

via llvm-bugs llvm-bugs at lists.llvm.org
Mon May 31 17:12:20 PDT 2021


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

            Bug ID: 50547
           Summary: crash on
                    llvm::codeview::CodeViewRecordIO::mapEncodedInteger
           Product: lld
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: COFF
          Assignee: unassignedbugs at nondot.org
          Reporter: mizvekov at gmail.com
                CC: llvm-bugs at lists.llvm.org

On trunk with assertions enabled, I observed the following crash:

ld.lld: /home/mizvekov/repos/llvm-project/llvm/include/llvm/ADT/APInt.h:1646:
int64_t llvm::APInt::getSExtValue() const: Assertion `getMinSignedBits() <= 64
&& "Too many bits for int64_t"' failed.

No backtrace was printed. I managed to get one running gdb:

#0  __GI_raise (sig=sig at entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7a6b537 in __GI_abort () at abort.c:79
#2  0x00007ffff7a6b40f in __assert_fail_base (fmt=0x7ffff7bd4128 "%s%s%s:%u:
%s%sAssertion `%s' failed.\n%n", 
    assertion=0x55555a969f88 "getMinSignedBits() <= 64 && \"Too many bits for
int64_t\"", 
    file=0x55555a969990
"/home/mizvekov/repos/llvm-project/llvm/include/llvm/ADT/APInt.h", line=1646,
function=<optimized out>)
    at assert.c:92
#3  0x00007ffff7a7a662 in __GI___assert_fail (
    assertion=0x55555a969f88 "getMinSignedBits() <= 64 && \"Too many bits for
int64_t\"", 
    file=0x55555a969990
"/home/mizvekov/repos/llvm-project/llvm/include/llvm/ADT/APInt.h", line=1646, 
    function=0x55555a969f58 "int64_t llvm::APInt::getSExtValue() const") at
assert.c:101
#4  0x0000555556434b7c in llvm::APInt::getSExtValue (this=0x7ffff55e4c40)
    at /home/mizvekov/repos/llvm-project/llvm/include/llvm/ADT/APInt.h:1646
#5  0x000055555a4e7326 in llvm::codeview::CodeViewRecordIO::mapEncodedInteger
(this=0x7ffff55e4bd0, Value=..., Comment=...)
    at
/home/mizvekov/repos/llvm-project/llvm/lib/DebugInfo/CodeView/CodeViewRecordIO.cpp:197
#6  0x00005555585d8485 in llvm::CodeViewDebug::emitStaticConstMemberList
(this=0x7fffe02119d0)
    at
/home/mizvekov/repos/llvm-project/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:3186
#7  0x00005555585d7d17 in llvm::CodeViewDebug::emitDebugInfoForGlobals
(this=0x7fffe02119d0)
    at
/home/mizvekov/repos/llvm-project/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:3121
#8  0x00005555585cbd65 in llvm::CodeViewDebug::endModule (this=0x7fffe02119d0)
    at
/home/mizvekov/repos/llvm-project/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp:619
#9  0x000055555850cc1a in llvm::AsmPrinter::doFinalization
(this=0x7fffe0027270, M=...)
    at
/home/mizvekov/repos/llvm-project/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp:1806
#10 0x000055555a745061 in llvm::FPPassManager::doFinalization
(this=0x7fffe02d4db0, M=...)
    at /home/mizvekov/repos/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1503
#11 0x000055555a7455da in (anonymous namespace)::MPPassManager::runOnModule
(this=0x7fffe0282bf0, M=...)
    at /home/mizvekov/repos/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1590
#12 0x000055555a740a3c in llvm::legacy::PassManagerImpl::run
(this=0x7fffe002ca50, M=...)
    at /home/mizvekov/repos/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:542
#13 0x000055555a745b81 in llvm::legacy::PassManager::run (this=0x7ffff55e5920,
M=...)
    at /home/mizvekov/repos/llvm-project/llvm/lib/IR/LegacyPassManager.cpp:1681
#14 0x0000555558a233df in codegen (Conf=..., TM=0x7fffe0005510, AddStream=...,
Task=41, Mod=..., CombinedIndex=...)
    at /home/mizvekov/repos/llvm-project/llvm/lib/LTO/LTOBackend.cpp:416
#15 0x0000555558a24066 in operator() (__closure=0x7ffff55e6160, Mod=...,
TM=0x7fffe0005510, 
    DiagnosticOutputFile=std::unique_ptr<llvm::ToolOutputFile> = {...})
    at /home/mizvekov/repos/llvm-project/llvm/lib/LTO/LTOBackend.cpp:585
#16 0x0000555558a24e7d in llvm::lto::thinBackend(llvm::lto::Config const&,
unsigned int, std::function<std::unique_ptr<llvm::lto::NativeObjectStream,
std::default_delete<llvm::lto::NativeObjectStream> > (unsigned int)>,
llvm::Module&, llvm::ModuleSummaryIndex const&,
llvm::StringMap<std::unordered_set<unsigned long, std::hash<unsigned long>,
std::equal_to<unsigned long>, std::allocator<unsigned long> >,
llvm::MallocAllocator> const&, llvm::DenseMap<unsigned long,
llvm::GlobalValueSummary*, llvm::DenseMapInfo<unsigned long>,
llvm::detail::DenseMapPair<unsigned long, llvm::GlobalValueSummary*> > const&,
llvm::MapVector<llvm::StringRef, llvm::BitcodeModule,
llvm::DenseMap<llvm::StringRef, unsigned int,
llvm::DenseMapInfo<llvm::StringRef>,
llvm::detail::DenseMapPair<llvm::StringRef, unsigned int> >,
std::vector<std::pair<llvm::StringRef, llvm::BitcodeModule>,
std::allocator<std::pair<llvm::StringRef, llvm::BitcodeModule> > > >*,
std::vector<unsigned char, std::allocator<unsigned char> > const&) (Conf=...,
Task=41, 
    AddStream=..., Mod=..., CombinedIndex=..., ImportList=...,
DefinedGlobals=..., ModuleMap=0x55556054dd60, 
    CmdArgs=std::vector of length 0, capacity 0) at
/home/mizvekov/repos/llvm-project/llvm/lib/LTO/LTOBackend.cpp:656
#17 0x00005555589f85b9 in operator() (__closure=0x7ffff55e6480, AddStream=...)
    at /home/mizvekov/repos/llvm-project/llvm/lib/LTO/LTO.cpp:1219
#18 0x00005555589f8872 in (anonymous
namespace)::InProcessThinBackend::runThinLTOBackendThread (this=0x55556045bc30,
    ., Cache=..., Task=41, BM=..., CombinedIndex=..., ImportList=...,
ExportList=..., 
    ResolvedODR=std::map with 28 elements = {...}, DefinedGlobals=...,
ModuleMap=...)
    at /home/mizvekov/repos/llvm-project/llvm/lib/LTO/LTO.cpp:1237
#19 0x00005555589f8a25 in operator() (__closure=0x555560911ba0, BM=...,
CombinedIndex=..., ImportList=..., ExportList=..., 
    ResolvedODR=std::map with 28 elements = {...}, DefinedGlobals=...,
ModuleMap=...)
    at /home/mizvekov/repos/llvm-project/llvm/lib/LTO/LTO.cpp:1265
...



frame 5
p Value
$2 = (llvm::APSInt &) @0x7ffff55e4c40: {<llvm::APInt> = {static WORDTYPE_MAX =
18446744073709551615, U = {VAL = 140736954335424, 
      pVal = 0x7fffe02b80c0}, BitWidth = 128}, IsUnsigned = false}

-- 
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/20210601/6417cc6b/attachment.html>


More information about the llvm-bugs mailing list