Closed Quuxplusone closed 10 years ago
I can still reproduce the crash with revision 144837.
I can still reproduce this assertion with revision 146373.
I have the same issue on OS X with the released version 3.0 of llvm/clang:
===========================================================================
clang version 3.0 (tags/RELEASE_30/final)
Target: x86_64-apple-darwin11.2.0
Thread model: posix
===========================================================================
While deleting: metadata %
An asserting value handle still pointed to this value!
UNREACHABLE executed at Value.cpp:561!
0 libLLVM-3.0.dylib 0x0000000102399742 _ZL15PrintStackTracePv + 34
1 libLLVM-3.0.dylib 0x0000000102399c69 _ZL13SignalHandleri + 697
2 libsystem_c.dylib 0x00007fff8b64ccfa _sigtramp + 26
3 libsystem_c.dylib 0x0000000000000262 _sigtramp + 18446603338177525122
4 libLLVM-3.0.dylib 0x0000000102399996 abort + 22
5 libLLVM-3.0.dylib 0x0000000102388704 llvm::llvm_unreachable_internal(char
const*, char const*, unsigned int) + 468
6 libLLVM-3.0.dylib 0x0000000102025ddc
llvm::ValueHandleBase::ValueIsDeleted(llvm::Value*) + 1260
7 libLLVM-3.0.dylib 0x0000000102025641 llvm::Value::~Value() + 49
8 libLLVM-3.0.dylib 0x000000010200a806 llvm::MDNode::destroy() + 22
9 libLLVM-3.0.dylib 0x0000000102007578
llvm::LLVMContextImpl::~LLVMContextImpl() + 1816
10 libLLVM-3.0.dylib 0x000000010200628f
llvm::object_deleter<llvm::LLVMContext>::call(void*) + 31
11 libLLVM-3.0.dylib 0x000000010238c460 llvm::llvm_shutdown() + 48
12 llc 0x0000000101c88562
13 llc 0x0000000101c871c4
Stack dump:
0. Program arguments: /usr/local/llvm/3.0/bin/llc -x86-asm-syntax=att -o
/tmp/llvm_QKkvXy/linked_executable.s /tmp/llvm_QKkvXy/linked_executable.bc
llvm-ld: Illegal instruction: 4
LLVM ERROR: Linker could not create executable!
I can reproduce this assertion in revision 150492.
Attached geti.bc
(425688 bytes, application/octet-stream): Bugpoint reduced simplified testcase
Attached geti_min.ll
(436 bytes, application/octet-stream): Further reduced test-case
Attached geti_min.ll
(444 bytes, text/plain): Further reduced test case
I think I localized the bug.
In DwarfDebug.cpp, method DwarfDebug::endModule(), this code around line 750:
LexicalScope *Scope =
new LexicalScope(NULL, DIDescriptor(SP), NULL, false);
DeadFnScopeMap[SP] = Scope;
Here, a new LexicalScope is allocated on the heap, and a mapping from SP (auto-
converted to MDNode*) is added to the map. In one case, the map already
contains a mapping for that MDNode*, so the old entry is lost, and the
LexicalScope, containing an AssertingVH in its Desc field, is never released.
This AssertingVH is the cause for the assertion in llvm_shutdown.
Nevertheless, I have no idea how to fix that bug :)
But I want to point out that it does not only occur on strange and illegal
debug information, like in the reduced test case, but also for regularly
compiled and linked programs.
I can reproduce this assertion with revision 156720.
I can reproduce this assertion with revision 165318.
While compiling clang with clang with "-g" option, I am also getting this
assertion violation with llc:
While deleting: metadata %
An asserting value handle still pointed to this value!
UNREACHABLE executed at
/home/ssahoo2/sw-bug-diagnosis/llvm-3.1/src/lib/VMCore/Value.cpp:620!
Has this bug been fixed in any version yet?
I can reproduce this assertion with revision 170352.
Seems to be fixed. Can't reproduce in release 3.3. Can you confirm this, Thomas?
I can no longer reproduce this assertion with revision 185734. It appears to be fixed. Thanks.
$ llc bugpoint-reduced-simplified.bc
While deleting: metadata %
!{null, null, null, metadata !"elapsed_time_", metadata !"elapsed_time_",
metadata !"elapsed_time_", null, metadata <badref>, null, null, null, null,
null, null, null, null, null, null, metadata <badref>, null}
An asserting value handle still pointed to this value!
UNREACHABLE executed at /home/arch/Build/llvm-3.3.src/lib/IR/Value.cpp:633!
0 libLLVMSupport.so 0x00007fb068e3e9e1 llvm::sys::PrintStackTrace(_IO_FILE*) +
38
1 libLLVMSupport.so 0x00007fb068e3ec5e
2 libLLVMSupport.so 0x00007fb068e3e6d7
3 libpthread.so.0 0x00007fb068705870
4 libc.so.6 0x00007fb06794d3d9 gsignal + 57
5 libc.so.6 0x00007fb06794e7d8 abort + 328
6 libLLVMSupport.so 0x00007fb068de5360
7 libLLVMCore.so 0x00007fb06989d3ca
llvm::ValueHandleBase::ValueIsDeleted(llvm::Value*) + 660
8 libLLVMCore.so 0x00007fb06989ba28 llvm::Value::~Value() + 62
9 libLLVMCore.so 0x00007fb06986b41f llvm::MDNode::~MDNode() + 279
10 libLLVMCore.so 0x00007fb06986b68f llvm::MDNode::destroy() + 67
11 libLLVMCore.so 0x00007fb06985fa98
llvm::LLVMContextImpl::~LLVMContextImpl() + 1692
12 libLLVMCore.so 0x00007fb06985dbc1 llvm::LLVMContext::~LLVMContext() + 39
13 libLLVMCore.so 0x00007fb06985e9a3
14 libLLVMSupport.so 0x00007fb068ded11f llvm::ManagedStaticBase::destroy()
const + 147
15 libLLVMSupport.so 0x00007fb068ded14d llvm::llvm_shutdown() + 21
16 llc 0x000000000041139b
17 llc 0x000000000040d0f3
18 libc.so.6 0x00007fb067939bc5 __libc_start_main + 245
19 llc 0x000000000040ca19
Stack dump:
0. Program arguments: llc bugpoint-reduced-simplified.bc
Aborted (core dumped)
Attached bugpoint-reduced-simplified.ll
(65046 bytes, application/octet-stream): new failed test case with llvm 3.3
FYI, since r190334, llc complains as below;
llc: llvm/lib/IR/DebugInfo.cpp:1413: llvm::DIScopeRef::DIScopeRef(const
llvm::Value*): Assertion `isScopeRef(V) && "DIScopeRef should be a MDString or
MDNode"' failed.
Also "opt -verify" complains.
Closing this, llc doesn't step into llvm_shutdown any more.
Please file new one, if such a complaint would be an issue to you.
Thanks, I'll bear with it util 3.4 comes out.
geti.bc
(425688 bytes, application/octet-stream)geti_min.ll
(436 bytes, application/octet-stream)geti_min.ll
(444 bytes, text/plain)bugpoint-reduced-simplified.ll
(65046 bytes, application/octet-stream)