llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
27.92k stars 11.52k forks source link

LLVM ERROR: Could not resolve external global address: __dso_handle, pure virtual method called #7493

Closed llvmbot closed 14 years ago

llvmbot commented 14 years ago
Bugzilla Link 7121
Resolution INVALID
Resolved on Jun 19, 2010 01:24
Version trunk
OS All
Reporter LLVM Bugzilla Contributor

Extended Description

I am not sure if the LLVM ERROR is also a bug in lli (or just related to a problem in my code). At least the pure virtual method call seems to be a bug in lli.

LLVM ERROR: Could not resolve external global address: __dso_handle pure virtual method called terminate called without an active exception

Program received signal SIGABRT, Aborted. 0x94cbee42 in __kill () (gdb) bt

​0 0x94cbee42 in __kill ()

​1 0x94cbee34 in kill$UNIX2003 ()

​2 0x94d3123a in raise ()

​3 0x94d3d679 in abort ()

​4 0x9472c005 in __gnu_cxx::__verbose_terminate_handler ()

​5 0x9472a10c in __gxx_personality_v0 ()

​6 0x9472a14b in std::terminate ()

​7 0x9472a6da in __cxa_pure_virtual ()

​8 0x00638c0f in llvm::raw_ostream::write (this=0x6f9b80, Ptr=0x69494d "While deleting: ", Size=16) at raw_ostream.cpp:249

​9 0x0063810e in llvm::circular_raw_ostream::write_impl (this=0x6f98c0, Ptr=0x69494d "While deleting: ", Size=16) at circular_raw_ostream.cpp:20

​10 0x00638c0f in llvm::raw_ostream::write (this=0x6f98c0, Ptr=0x69494d "While deleting: ", Size=16) at raw_ostream.cpp:249

​11 0x00206a3a in llvm::raw_ostream::operator<< (this=0x6f98c0, Str={static npos = 4294967295, Data = 0x69494d "While deleting: ", Length = 16}) at raw_ostream.h:179

​12 0x001ac141 in llvm::raw_ostream::operator<< (this=0x6f98c0, Str=0x69494d "While deleting: ") at raw_ostream.h:190

​13 0x005e1e24 in llvm::Value::~Value (this=0x48dc3d0) at Value.cpp:69

​14 0x000125e2 in llvm::User::~User (this=0x48dc3d0) at User.h:79

​15 0x000132f8 in llvm::Constant::~Constant (this=0x48dc3d0) at Constant.h:42

​16 0x000139f4 in llvm::ConstantExpr::~ConstantExpr (this=0x48dc3d0) at Constants.h:650

​17 0x00541de4 in llvm::GetElementPtrConstantExpr::~GetElementPtrConstantExpr (this=0x48dc3d0) at ConstantsContext.h:204

​18 0x005a080f in llvm::ConstantUniqueMap<llvm::ExprMapKeyType, llvm::Type, llvm::ConstantExpr, false>::freeConstants (this=0x180728c) at ConstantsContext.h:604

​19 0x0059c9d0 in llvm::LLVMContextImpl::~LLVMContextImpl (this=0x1807000) at LLVMContextImpl.cpp:64

​20 0x0059ae1c in llvm::LLVMContext::~LLVMContext (this=0x1501330) at LLVMContext.cpp:35

​21 0x0059b855 in llvm::object_deleter::call (Ptr=0x1501330) at ManagedStatic.h:31

​22 0x00624af4 in llvm::ManagedStaticBase::destroy (this=0x6f9308) at ManagedStatic.cpp:61

​23 0x00624b2d in llvm::llvm_shutdown () at ManagedStatic.cpp:71

​24 0x0000189e in do_shutdown () at lli.cpp:102

​25 0x94c79da7 in __cxa_finalize ()

​26 0x94c79c90 in exit ()

​27 0x00623266 in llvm::report_fatal_error (reason=@0xbfffe74c) at ErrorHandling.cpp:55

​28 0x00267e44 in llvm::ExecutionEngine::emitGlobals (this=0x1501620) at ExecutionEngine.cpp:1055

​29 0x0023b5ee in llvm::Interpreter::Interpreter (this=0x1501620, M=0x1511680) at Interpreter.cpp:55

​30 0x0023b663 in llvm::Interpreter::create (M=0x1511680, ErrStr=0xbfffe988) at Interpreter.cpp:41

​31 0x00263384 in llvm::EngineBuilder::create (this=0xbfffe910) at ExecutionEngine.cpp:480

​32 0x00001da3 in main (argc=30, argv=0xbfffea64, envp=0xbfffeae0) at lli.cpp:175

lattner commented 14 years ago

Unfortunately, we need a small testcase to be able to reproduce and fix this. Please reopen if you can produce one, thanks!

llvmbot commented 14 years ago

Well, I just start it again and always get the same crash and error. But it would be kind of complicated for you to reproduce that (you would need a lot of files from my environment). And you need all of them because it will not start otherwise. All of the stuff is available and open though, so I can explain how you can install and setup everything. But not sure if you really want to do that.

I also tried to reduce the test case a bit. I wasn't able yet to reproduce the problem about the missing __dso_handle address. I also couldn't reproduce the pure virtual function call. However, I could reproduce mostly the same crash. See bug #​7131 about it.

llvmbot commented 14 years ago

Please explain how to reproduce this.

llvmbot commented 14 years ago

(gdb) bt full

​0 0x94cbee42 in __kill ()

No symbol table info available.

​1 0x94cbee34 in kill$UNIX2003 ()

No symbol table info available.

​2 0x94d3123a in raise ()

No symbol table info available.

​3 0x94d3d679 in abort ()

No symbol table info available.

​4 0x9472c005 in __gnu_cxx::__verbose_terminate_handler ()

No symbol table info available.

​5 0x9472a10c in __gxx_personality_v0 ()

No symbol table info available.

​6 0x9472a14b in std::terminate ()

No symbol table info available.

​7 0x9472a6da in __cxa_pure_virtual ()

No symbol table info available.

​8 0x00638c0f in llvm::raw_ostream::write (this=0x6f9b80, Ptr=0x69494d "While deleting: ", Size=16) at raw_ostream.cpp:249

No locals.

​9 0x0063810e in llvm::circular_raw_ostream::write_impl (this=0x6f98c0, Ptr=0x69494d "While deleting: ", Size=16) at circular_raw_ostream.cpp:20

No locals.

​10 0x00638c0f in llvm::raw_ostream::write (this=0x6f98c0, Ptr=0x69494d "While deleting: ", Size=16) at raw_ostream.cpp:249

No locals.

​11 0x00206a3a in llvm::raw_ostream::operator<< (this=0x6f98c0, Str={static npos = 4294967295, Data = 0x69494d "While deleting: ", Length = 16}) at raw_ostream.h:179

Size = 16

​12 0x001ac141 in llvm::raw_ostream::operator<< (this=0x6f98c0, Str=0x69494d "While deleting: ") at raw_ostream.h:190

No locals.

​13 0x005e1e24 in llvm::Value::~Value (this=0x48dc3d0) at Value.cpp:69

No locals.

​14 0x000125e2 in llvm::User::~User (this=0x48dc3d0) at User.h:79

No locals.

​15 0x000132f8 in llvm::Constant::~Constant (this=0x48dc3d0) at Constant.h:42

No locals.

​16 0x000139f4 in llvm::ConstantExpr::~ConstantExpr (this=0x48dc3d0) at Constants.h:650

No locals.

​17 0x00541de4 in llvm::GetElementPtrConstantExpr::~GetElementPtrConstantExpr (this=0x48dc3d0) at ConstantsContext.h:204

No locals.

​18 0x005a080f in llvm::ConstantUniqueMap<llvm::ExprMapKeyType, llvm::Type, llvm::ConstantExpr, false>::freeConstants (this=0x180728c) at ConstantsContext.h:604

I = {

_M_node = 0x48dc3f0 } E = { _M_node = 0x1807294 }

​19 0x0059c9d0 in llvm::LLVMContextImpl::~LLVMContextImpl (this=0x1807000) at LLVMContextImpl.cpp:64

MDNodes = {

<llvm::SmallVectorImpl<llvm::MDNode>> = { <llvm::SmallVectorTemplateBase<llvm::MDNode,true>> = { <llvm::SmallVectorTemplateCommon<llvm::MDNode*>> = {

= { BeginX = 0xa05ec400, EndX = 0x0, CapacityX = 0x1512bac, FirstEl = { X = 0 '\0' } }, }, }, }, members of llvm::SmallVector: InlineElts = {{ X = 0 '\0' }, { X = -8 '?' }, { X = 0 '\0' }} } #​20 0x0059ae1c in llvm::LLVMContext::~LLVMContext (this=0x1501330) at LLVMContext.cpp:35 No locals. #​21 0x0059b855 in llvm::object_deleter::call (Ptr=0x1501330) at ManagedStatic.h:31 No locals. #​22 0x00624af4 in llvm::ManagedStaticBase::destroy (this=0x6f9308) at ManagedStatic.cpp:61 __func__ = "destroy" #​23 0x00624b2d in llvm::llvm_shutdown () at ManagedStatic.cpp:71 No locals. #​24 0x0000189e in do_shutdown () at lli.cpp:102 No locals. #​25 0x94c79da7 in __cxa_finalize () No symbol table info available. #​26 0x94c79c90 in exit () No symbol table info available. #​27 0x00623266 in llvm::report_fatal_error (reason=@0xbfffe74c) at ErrorHandling.cpp:55 No locals. #​28 0x00267e44 in llvm::ExecutionEngine::emitGlobals (this=0x1501620) at ExecutionEngine.cpp:1055 SymAddr = (void *) 0x0 I = { <> = {}, members of llvm::ilist_iterator: NodePtr = 0x361540c } E = { <> = {}, members of llvm::ilist_iterator: NodePtr = 0x360a66c } M = (llvm::Module &) @​0x1511680: { Context = @​0x1501330, GlobalList = { > = { > = { > = { > = {}, > = {}, > = {}, }, }, }, members of llvm::iplist >: Head = 0x360a39c }, FunctionList = { > = { > = { > = { > = {}, > = {}, > = {}, }, }, members of llvm::ilist_traits: Sentinel = { > = { Prev = 0x378fc20 }, members of llvm::ilist_node: Next = 0x0 } }, members of llvm::iplist >: Head = 0x36be990 }, AliasList = { > = { > = { > = { > = {}, > = {}, > = {}, }, }, }, members of llvm::iplist >: Head = 0x0 }, LibraryList = { , std::allocator >,std::allocator, std::allocator > > >> = { _M_impl = { , std::allocator > >> = { <__gnu_cxx::new_allocator, std::allocator > >> = {}, }, members of std::_Vector_base, std::allocator >,std::allocator, std::allocator > > >::_Vector_impl: _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0 } }, }, NamedMDList = { > = { > = { > = { > = {}, > = {}, > = {}, }, }, members of llvm::ilist_traits: Sentinel = { > = { Prev = 0x0 }, members of llvm::ilist_node: Next = 0x0 } }, members of llvm::iplist >: Head = 0x1511690 }, GlobalScopeAsm = { static npos = 4294967295, _M_dataplus = { > = { <__gnu_cxx::new_allocator> = {}, }, members of std::basic_string,std::allocator >::_Alloc_hider: _M_p = 0x182300c "\t.objc_class_name_DumpSymbols=0\n\t.globl .objc_class_name_DumpSymbols\n\t.objc_class_name_MachSection=0\n\t.globl .objc_class_name_MachSection\n\t.lazy_reference .objc_class_name_NSString\n\t.lazy_reference .o"... } }, ValSymTab = 0x1501500, TypeSymTab = 0x1501520, Materializer = { Ptr = 0x0 }, ModuleID = { static npos = 4294967295, _M_dataplus = { > = { <__gnu_cxx::new_allocator> = {}, }, members of std::basic_string,std::allocator >::_Alloc_hider: _M_p = 0x15014ec "olx.nodebug.bc" } }, TargetTriple = { static npos = 4294967295, _M_dataplus = { > = { <__gnu_cxx::new_allocator> = {}, }, members of std::basic_string,std::allocator >::_Alloc_hider: _M_p = 0x15024dc "i386-apple-darwin9.0.0" } }, DataLayout = { static npos = 4294967295, _M_dataplus = { > = { <__gnu_cxx::new_allocator> = {}, }, members of std::basic_string,std::allocator >::_Alloc_hider: _M_p = 0x360a3dc "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:128:128-n8:16:32" } }, NamedMDSymTab = 0x1501540 } m = 0 e = 1 LinkedGlobalsMap = { _M_t = { _M_impl = { , std::allocator >, const llvm::Type*>, const llvm::GlobalValue*> > >> = { <__gnu_cxx::new_allocator, std::allocator >, const llvm::Type*>, const llvm::GlobalValue*> > >> = {}, }, members of std::_Rb_tree, std::allocator >, const llvm::Type*>,std::pair, std::allocator >, const llvm::Type*>, const llvm::GlobalValue*>,std::_Select1st, std::allocator >, const llvm::Type*>, const llvm::GlobalValue*> >,std::less, std::allocator >, const llvm::Type*> >,std::allocator, std::allocator >, const llvm::Type*>, const llvm::GlobalValue*> > >::_Rb_tree_impl, std::allocator >, const llvm::Type*> >,false>: _M_key_compare = { <> = {}, }, _M_header = { _M_color = std::_S_red, _M_parent = 0x0, _M_left = 0xbfffe6ec, _M_right = 0xbfffe6ec }, _M_node_count = 0 } } } NonCanonicalGlobals = { >> = { _M_impl = { > = { <__gnu_cxx::new_allocator> = {}, }, members of std::_Vector_base >::_Vector_impl: _M_start = 0x0, _M_finish = 0x0, _M_end_of_storage = 0x0 } }, } __func__ = "emitGlobals" #​29 0x0023b5ee in llvm::Interpreter::Interpreter (this=0x1501620, M=0x1511680) at Interpreter.cpp:55 No locals. #​30 0x0023b663 in llvm::Interpreter::create (M=0x1511680, ErrStr=0xbfffe988) at Interpreter.cpp:41 No locals. #​31 0x00263384 in llvm::EngineBuilder::create (this=0xbfffe910) at ExecutionEngine.cpp:480 No locals. #​32 0x00001da3 in main (argc=30, argv=0xbfffea64, envp=0xbfffeae0) at lli.cpp:175 X = { = { _vptr$PrettyStackTraceEntry = 0x6f5488, NextEntry = 0x0 }, members of llvm::PrettyStackTraceProgram: ArgC = 30, ArgV = 0xbfffea64 } Context = (llvm::LLVMContext &) @​0x1501330: { pImpl = 0x1807000 } ErrorMsg = { static npos = 4294967295, _M_dataplus = { > = { <__gnu_cxx::new_allocator> = {}, }, members of std::basic_string,std::allocator >::_Alloc_hider: _M_p = 0xa051d6e4 "" } } Mod = (class llvm::Module *) 0x1511680 builder = { M = 0x1511680, WhichEngine = llvm::EngineKind::Interpreter, ErrorStr = 0xbfffe988, OptLevel = llvm::CodeGenOpt::Default, JMM = 0x0, AllocateGVsWithCode = false, CMModel = llvm::CodeModel::Default, MArch = { static npos = 4294967295, _M_dataplus = { > = { <__gnu_cxx::new_allocator> = {}, }, members of std::basic_string,std::allocator >::_Alloc_hider: _M_p = 0xa051d6e4 "" } }, MCPU = { static npos = 4294967295, _M_dataplus = { > = { <__gnu_cxx::new_allocator> = {}, }, members of std::basic_string,std::allocator >::_Alloc_hider: _M_p = 0xa051d6e4 "" } }, MAttrs = { , std::allocator > >> = { , std::allocator >,false>> = { , std::allocator > >> = { = { BeginX = 0xbfffe948, EndX = 0xbfffe948, CapacityX = 0xbfffe958, FirstEl = { X = 0 '\0' } }, }, }, }, members of llvm::SmallVector, std::allocator >,4u>: InlineElts = {{ X = -64 '?' }} } } OLvl = llvm::CodeGenOpt::Default EntryFn = (class llvm::Function *) 0x8fe005bc Exit = (class llvm::Constant *) 0xbfffeb54 Result = 0