Skip to content

Assertion failure when reducing a program #49783

@langston-barrett

Description

@langston-barrett
Bugzilla Link 50439
Version trunk
OS Linux
CC @dwblaikie

Extended Description

I encountered this assertion failure when reducing a file with llvm-reduce. Unfortunately, this only occurs after several reductions and I can't share the script that decides the "interestingness" of program. I thought I'd still go ahead and post this since the error message asked me to.

llvm-reduce: /x/llvm-project/llvm/include/llvm/IR/InstrTypes.h:1342: llvm::Value *llvm::CallBase::getArgOperand(unsigned int) const: Assertion `i < getNumArgOperands() && "Out of bounds!"' failed.
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /x/llvm-reduce --test=././reduce.py /x/testcases/reduced.bc
#&#8203;0 0x0000000000905eda llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /x/llvm-project/llvm/lib/Support/Unix/Signals.inc:565:11
#&#8203;1 0x00000000009060ab PrintStackTraceSignalHandler(void*) /x/llvm-project/llvm/lib/Support/Unix/Signals.inc:632:1
#&#8203;2 0x000000000090467b llvm::sys::RunSignalHandlers() /x/llvm-project/llvm/lib/Support/Signals.cpp:75:5
#&#8203;3 0x0000000000906821 SignalHandler(int) /x/llvm-project/llvm/lib/Support/Unix/Signals.inc:407:1
#&#8203;4 0x00007f751937c3c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x153c0)
#&#8203;5 0x00007f7518e1118b raise /build/glibc-eX1tMB/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#&#8203;6 0x00007f7518df0859 abort /build/glibc-eX1tMB/glibc-2.31/stdlib/abort.c:81:7
#&#8203;7 0x00007f7518df0729 get_sysdep_segment_value /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:509:8
#&#8203;8 0x00007f7518df0729 _nl_load_domain /build/glibc-eX1tMB/glibc-2.31/intl/loadmsgcat.c:970:34
#&#8203;9 0x00007f7518e01f36 (/lib/x86_64-linux-gnu/libc.so.6+0x36f36)
#&#8203;10 0x000000000049a053 llvm::CallBase::getArgOperand(unsigned int) const /x/llvm-project/llvm/include/llvm/IR/InstrTypes.h:1343:23
#&#8203;11 0x00000000005e572d llvm::DbgVariableIntrinsic::getRawVariable() const /x/llvm-project/llvm/include/llvm/IR/IntrinsicInst.h:261:12
#&#8203;12 0x00000000005e4325 llvm::DbgVariableIntrinsic::getVariable() const /x/llvm-project/llvm/include/llvm/IR/IntrinsicInst.h:249:12
#&#8203;13 0x00000000007165c5 llvm::DebugInfoFinder::processVariable(llvm::Module const&, llvm::DbgVariableIntrinsic const&) /x/llvm-project/llvm/lib/IR/DebugInfo.cpp:283:13
#&#8203;14 0x00000000007160a5 llvm::DebugInfoFinder::processInstruction(llvm::Module const&, llvm::Instruction const&) /x/llvm-project/llvm/lib/IR/DebugInfo.cpp:197:21
#&#8203;15 0x00000000009453fc llvm::CloneBasicBlock(llvm::BasicBlock const*, llvm::ValueMap<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false> > >&, llvm::Twine const&, llvm::Function*, llvm::ClonedCodeInfo*, llvm::DebugInfoFinder*) /x/llvm-project/llvm/lib/Transforms/Utils/CloneFunction.cpp:60:28
#&#8203;16 0x0000000000945d90 llvm::CloneFunctionInto(llvm::Function*, llvm::Function const*, llvm::ValueMap<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false> > >&, llvm::CloneFunctionChangeType, llvm::SmallVectorImpl<llvm::ReturnInst*>&, char const*, llvm::ClonedCodeInfo*, llvm::ValueMapTypeRemapper*, llvm::ValueMaterializer*) /x/llvm-project/llvm/lib/Transforms/Utils/CloneFunction.cpp:174:17
#&#8203;17 0x00000000009469b4 llvm::CloneFunction(llvm::Function*, llvm::ValueMap<llvm::Value const*, llvm::WeakTrackingVH, llvm::ValueMapConfig<llvm::Value const*, llvm::sys::SmartMutex<false> > >&, llvm::ClonedCodeInfo*) /x/llvm-project/llvm/lib/Transforms/Utils/CloneFunction.cpp:316:10
#&#8203;18 0x0000000000422019 extractArgumentsFromModule(std::vector<llvm::Chunk, std::allocator<llvm::Chunk> >, llvm::Module*) /x/llvm-project/llvm/tools/llvm-reduce/deltas/ReduceArguments.cpp:89:11
#&#8203;19 0x000000000042d39f std::_Function_handler<void (std::vector<llvm::Chunk, std::allocator<llvm::Chunk> > const&, llvm::Module*), void (*)(std::vector<llvm::Chunk, std::allocator<llvm::Chunk> >, llvm::Module*)>::_M_invoke(std::_Any_data const&, std::vector<llvm::Chunk, std::allocator<llvm::Chunk> > const&, llvm::Module*&&) /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_function.h:300:2
#&#8203;20 0x000000000041ae30 std::function<void (std::vector<llvm::Chunk, std::allocator<llvm::Chunk> > const&, llvm::Module*)>::operator()(std::vector<llvm::Chunk, std::allocator<llvm::Chunk> > const&, llvm::Module*) const /usr/bin/../lib/gcc/x86_64-linux-gnu/9/../../../../include/c++/9/bits/std_function.h:688:7
#&#8203;21 0x00000000004197f0 llvm::runDeltaPass(llvm::TestRunner&, int, std::function<void (std::vector<llvm::Chunk, std::allocator<llvm::Chunk> > const&, llvm::Module*)>) /x/llvm-project/llvm/tools/llvm-reduce/deltas/Delta.cpp:148:31
#&#8203;22 0x000000000042173c llvm::reduceArgumentsDeltaPass(llvm::TestRunner&) /x/llvm-project/llvm/tools/llvm-reduce/deltas/ReduceArguments.cpp:125:3
#&#8203;23 0x00000000004111a6 runAllDeltaPasses(llvm::TestRunner&) /x/llvm-project/llvm/tools/llvm-reduce/DeltaManager.cpp:58:3
#&#8203;24 0x0000000000411097 llvm::runDeltaPasses(llvm::TestRunner&) /x/llvm-project/llvm/tools/llvm-reduce/DeltaManager.cpp:84:3
#&#8203;25 0x0000000000458635 main /x/llvm-project/llvm/tools/llvm-reduce/llvm-reduce.cpp:126:15
#&#8203;26 0x00007f7518df20b3 __libc_start_main /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:342:3
#&#8203;27 0x0000000000410cae _start (/x/llvm-reduce+0x410cae)

Version/host info:

./llvm-reduce -version
LLVM (http://llvm.org/):
  LLVM version 13.0.0git
  DEBUG build with assertions.
  Default target: x86_64-unknown-linux-gnu
  Host CPU: znver2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillaincompleteIssue not complete (e.g. missing a reproducer, build arguments, etc.)llvm-reduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions