[LLVMdev] Static destructor problem with recent HEAD

Talin viridia at gmail.com
Sat Oct 15 23:19:59 PDT 2011


On Sat, Oct 15, 2011 at 9:49 PM, Chandler Carruth <chandlerc at google.com>wrote:

> On Sat, Oct 15, 2011 at 9:20 PM, Talin <viridia at gmail.com> wrote:
>
>> I recently updated my version of LLVM from revision 140108 to 142082, and
>> several things broke, most of which were easily fixed. However, I'm now
>> getting a "pure virtual method called" exception (__cxa_pure_virtual) which
>> I wasn't getting before. This is happening in the destructor of a
>> statically-initialized object. (More precisely, it's blowing up in a
>> BumpPtrAllocator, which is used by a StringMap, which is in turn a member of
>> a statically initialized object.)
>>
>> Anyone know what might have changed recently that would cause this?
>>
>
> It would help a lot to see the actual backtrace etc. ;]
>

Sure thing (although I'm not sure that this will tell you all that much):

#0  0x00007fff878d8fbb in __cxa_pure_virtual ()
#1  0x0000000100f3f166 in llvm::BumpPtrAllocator::DeallocateSlabs
(this=0x1016e48a8, Slab=0x103889e00) at
/Users/talin/Projects/llvm/lib/Support/Allocator.cpp:71
#2  0x0000000100f3f0b9 in llvm::BumpPtrAllocator::~BumpPtrAllocator
(this=0x1016e48a8) at
/Users/talin/Projects/llvm/lib/Support/Allocator.cpp:29
#3  0x0000000100f3f095 in llvm::BumpPtrAllocator::~BumpPtrAllocator
(this=0x1016e48a8) at
/Users/talin/Projects/llvm/lib/Support/Allocator.cpp:28
#4  0x00000001000aeb3a in llvm::StringMap<llvm::SmallVector<tart::Defn*,
4u>, llvm::BumpPtrAllocator>::~StringMap (this=0x1016e4890) at
StringMap.h:406
#5  0x00000001000aeaa5 in llvm::StringMap<llvm::SmallVector<tart::Defn*,
4u>, llvm::BumpPtrAllocator>::~StringMap (this=0x1016e4890) at
StringMap.h:403
#6  0x00000001000aea7c in tart::SymbolTable::~SymbolTable (this=0x1016e4888)
at SymbolTable.h:34
#7  0x00000001000aea45 in tart::OrderedSymbolTable::~OrderedSymbolTable
(this=0x1016e4888) at SymbolTable.h:74
#8  0x00000001000aea15 in tart::OrderedSymbolTable::~OrderedSymbolTable
(this=0x1016e4888) at SymbolTable.h:74
#9  0x00000001000ae809 in tart::IterableScope::~IterableScope
(this=0x1016e4880) at Scope.h:76
#10 0x00000001001e22d5 in tart::IterableScope::~IterableScope
(this=0x1016e4880) at Scope.h:76
#11 0x00000001001e2267 in tart::FunctionDefn::~FunctionDefn
(this=0x1016e4710) at FunctionDefn.h:103
#12 0x00000001000cf821 in ~IntegerBinOpFunction (this=0x1016e4710) at
/Users/talin/Projects/tart/trunk/compiler/lib/Objects/Operators.cpp:56
#13 0x00000001000c1f65 in ~IntegerBinOpFunction (this=0x1016e4710) at
/Users/talin/Projects/tart/trunk/compiler/lib/Objects/Operators.cpp:54
#14 0x00007fff830e6374 in __cxa_finalize ()
#15 0x00007fff830e628c in exit ()
#16 0x0000000100001a3b in start ()

I would generally expect this kind of "pure virtual" error to be the result
of double-destruction - the first destruction having swizzled the vtable
pointer of the object in question. But my debugging of the code shows no
evidence of this. So I'm not sure what's going on.

-- 
-- Talin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111015/ad0adc5e/attachment.html>


More information about the llvm-dev mailing list