[LLVMdev] How can I see what opt tries to delete at the end of a pass?

Duncan Sands baldrick at free.fr
Sat Feb 4 00:44:52 PST 2012


Hi Griffin, if you are completely stuck, upload all the code and instructions
for how to reproduce somewhere, and if you are lucky someone here may try to
debug it for you.

Ciao, Duncan.

> I've been stuck with a problem for about a month, and it has stumped
> everyone in my lab.  I have a function pass that runs, and when it finishes
> and opt goes to return, I get:
>
> While deleting: void %
> An asserting value handle still pointed to this value!
> UNREACHABLE executed at /x/grwright/llvm/llvm-2.9/lib/VMCore/Value.cpp:569!
>
> On a simple test case, the error becomes 'i32 %' instead of 'void %'.  I
> cannot for the life of me figure out what is happening.  I'm not deleting
> anything extra internal to my pass that I can tell, and I'm not sure how to
> go about debugging it.  All I get from output/gdb is along the lines of
> what you see below.
>
> Is there a way to see a breakdown of what exactly opt is doing, value by
> value, after it hits return at the end of opt.cpp?
>
> Thanks!
> -Griffin Wright
>
> While deleting: void %
> An asserting value handle still pointed to this value!
> UNREACHABLE executed at /x/grwright/llvm/llvm-2.9/lib/VMCore/Value.cpp:569!
> 0  libLLVM-2.9.so 0x569fa56b
> 1  libLLVM-2.9.so 0x569fa2f8
> 2                 0x55573400 __kernel_sigreturn + 0
> 3  libc.so.6      0x57422d52 abort + 386
> 4  libLLVM-2.9.so 0x569e60d4 llvm::SmallVector<char, 64u>::~SmallVector() +
> 0
> 5  libLLVM-2.9.so 0x5655ee2e
> llvm::ValueHandleBase::ValueIsDeleted(llvm::Value*) + 662
> 6  libLLVM-2.9.so 0x5655d1ec llvm::Value::~Value() + 58
> 7  libLLVM-2.9.so 0x561f0041 llvm::User::~User() + 93
> 8  libLLVM-2.9.so 0x56502d89 llvm::Instruction::~Instruction() + 121
> 9  libLLVM-2.9.so 0x5650551f llvm::CallInst::~CallInst() + 57
> 10 libLLVM-2.9.so 0x563db671
> llvm::ilist_node_traits<llvm::Instruction>::deleteNode(llvm::Instruction*)
> + 30
> 11 libLLVM-2.9.so 0x563dac80 llvm::iplist<llvm::Instruction,
> llvm::ilist_traits<llvm::Instruction>
>> ::erase(llvm::ilist_iterator<llvm::Instruction>) + 48
> 12 libLLVM-2.9.so 0x5646cc37 llvm::iplist<llvm::Instruction,
> llvm::ilist_traits<llvm::Instruction>
>> ::erase(llvm::ilist_iterator<llvm::Instruction>,
> llvm::ilist_iterator<llvm::Instruction>) + 49
> 13 libLLVM-2.9.so 0x5646c7a0 llvm::iplist<llvm::Instruction,
> llvm::ilist_traits<llvm::Instruction>  >::clear() + 102
> 14 libLLVM-2.9.so 0x5646b420 llvm::BasicBlock::~BasicBlock() + 314
> 15 libLLVM-2.9.so 0x5646cdb2
> llvm::ilist_node_traits<llvm::BasicBlock>::deleteNode(llvm::BasicBlock*) +
> 30
> 16 libLLVM-2.9.so 0x5646c9a8 llvm::iplist<llvm::BasicBlock,
> llvm::ilist_traits<llvm::BasicBlock>
>> ::erase(llvm::ilist_iterator<llvm::BasicBlock>) + 48
> 17 libLLVM-2.9.so 0x5646b58f llvm::BasicBlock::eraseFromParent() + 77
> 18 libLLVM-2.9.so 0x564b9b11 llvm::Function::dropAllReferences() + 159
> 19 libLLVM-2.9.so 0x5652fc59 llvm::Module::dropAllReferences() + 81
> 20 libLLVM-2.9.so 0x5652eaf2 llvm::Module::~Module() + 50
> 21 opt            0x08081e36 std::auto_ptr<llvm::Module>::~auto_ptr() + 36
> 22 opt            0x0807d5a4 main + 5045
> 23 libc.so.6      0x5740bbd6 __libc_start_main + 230
> 24 opt            0x0806de41
>
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list