Re: Persistency of custom container

From: Roel Aaij <Roel.Aaij_at_cern.ch>
Date: Sat, 2 Jan 2010 16:16:57 +0100


Hi Axel,

First of all, A happy new, year!

> by default, all objects pointed to are stored. So it should "just > work".

My container only keeps 1 pointer to the first object and then uses a size member and pointer arithmetic to access the other items. It also uses a privately inherited std::allocator to allocate a certain capacity, which is generally somewhat more than the size of the container.

When I try to use it out of the box, I get a segfault in TStreamerBase, the stack trace is added at the bottom. I guess some extra information needs to be provided to ROOT before everything works as intended. Perhaps I should write a custom streamer?

In case a look at the code is needed, all of my code, including a Makefile is attached.

Greetings, Roel



There was a crash.
This is the entire stack trace of all threads:

#0 0xb778a424 in __kernel_vsyscall ()
#1 0xb6bff273 in waitpid () from /lib/libc.so.6
#2 0xb6b9f1db in ?? () from /lib/libc.so.6
#3 0xb726c33d in TUnixSystem::Exec(char const*) () from
/usr/lib/root/libCore.so.5.26
#4 0xb7272708 in TUnixSystem::StackTrace() () from
/usr/lib/root/libCore.so.5.26
#5 0xb7273955 in TUnixSystem::DispatchSignals(ESignals) () from
/usr/lib/root/libCore.so.5.26
#6 0xb7273a5d in ?? () from /usr/lib/root/libCore.so.5.26
#7 0xb72696c2 in ?? () from /usr/lib/root/libCore.so.5.26
#8 <signal handler called>
#9 0xb7267461 in TStreamerBase::TStreamerBase(char const*, char const*,
int) () from /usr/lib/root/libCore.so.5.26
#10 0xb6a531bf in TStreamerInfo::Build() () from
/usr/lib/root/libRIO.so.5.26
#11 0xb723dbc4 in TClass::GetStreamerInfo(int) const () from
/usr/lib/root/libCore.so.5.26
#12 0xb6a531e7 in TStreamerInfo::Build() () from
/usr/lib/root/libRIO.so.5.26
#13 0xb723dbc4 in TClass::GetStreamerInfo(int) const () from
/usr/lib/root/libCore.so.5.26
#14 0xb6ec228d in TTree::BuildStreamerInfo(TClass*, void*) () from
/usr/lib/root/libTree.so.5.26
#15 0xb6ec27f3 in TTree::BronchExec(char const*, char const*, void*,
bool, int, int) () from /usr/lib/root/libTree.so.5.26
#16 0xb6eb88ff in TTree::Bronch(char const*, char const*, void*, int,
int) () from /usr/lib/root/libTree.so.5.26
#17 0xb6eb88b8 in TTree::Branch(char const*, char const*, void*, int,
int) () from /usr/lib/root/libTree.so.5.26
#18 0xb6ebc0d0 in TTree::BranchImp(char const*, char const*, TClass*,
void*, int, int) () from /usr/lib/root/libTree.so.5.26
#19 0x0804f27f in TTree::Branch<Solar::DataVector<Event::Track,
std::allocator<Event::Track*> > > (this=0x845b8b0, name=0x8052a37 "Branch",

    classname=0x80529f8
"Solar::DataVector<Event::Track,std::allocator<Event::Track*> >", addobj=0xbfab54bc, bufsize=32000, splitlevel=99) at /usr/include/root/TTree.h:232
#20 0x0804eadc in main () at test_write.cpp:31


Received on Sat Jan 02 2010 - 16:17:06 CET

This archive was generated by hypermail 2.2.0 : Sun Jan 03 2010 - 23:50:01 CET