I’ve got a bug and I can’t figure out what it is. I’ve got an object graph that I write out to a file and then read back. On the readback I get a crash in the destructor of one of my objects. I don’t understand why it is occuring in the destructor during read back…
I can open the file in root (after building the required objects) and when I try to read it back in root I get a crash there too. Attached is gDebug=5 output of what happened.
Here is the crash:
[code] FlowBase_cpp.dll!ROOT::delete_FlowBase(void * p) Line 140 + 0x19 bytes C++
libCore.dll!TClass::Destructor(void * obj, bool dtorOnly) Line 3948 + 0x11 bytes C++
libRIO.dll!TBufferFile::ReadFastArray(void * * start, const TClass * cl, int n, bool isPreAlloc, TMemberStreamer * streamer, const TClass * onFileClass) Line 1524 C++
libRIO.dll!TStreamerInfo::ReadBuffer(TBuffer & b, const TVirtualCollectionProxy & arr, int first, int narr, int eoffset, int arrayMode) Line 1001 + 0x47 bytes C++
libRIO.dll!TStreamerInfo::ReadBufferSTL(TBuffer & b, TVirtualCollectionProxy * cont, int nc, int first, int eoffset) Line 1813 + 0x1e bytes C++
libRIO.dll!TStreamerInfo::ReadBuffer<char * *>(TBuffer & b, char * * const & arr, int first, int narr, int eoffset, int arrayMode) Line 1205 C++
libRIO.dll!TBufferFile::ReadClassBuffer(const TClass * cl, void * pointer, const TClass * onFileClass) Line 3464 C++
FlowSequential_cpp.dll!FlowSequential::Streamer(TBuffer & R__b) Line 176 + 0x1e bytes C++
libRIO.dll!TKey::ReadObj() Line 717 + 0x19 bytes C++
ROOTFileIO_cpp.dll!ReadWriteInputList(TList * list) Line 291 + 0x12 bytes C++
ROOTFileIO_cpp.dll!ROOTTFile::RunAJob(const std::basic_string<char,std::char_traits,std::allocator > & inputDS, const std::basic_string<char,std::char_traits,std::allocator > & outputDS, FlowBase * flow) Line 236 + 0x9 bytes C++
ROOTFileIO_cpp.dll!ROOTFileIOBase::RunAllJobs(FlowBase * flow) Line 78 + 0x48 bytes C++
runDriver_cpp.dll!runDriver(bool compileOnly, char * jobFileXMLName, char * runOnly) Line 127 + 0xc bytes C++
runDriver_cpp.dll!G__runDriver_cpp_ACLiC_dict__0_927(G__value * result7, const char * funcname, G__param * libp, int hash) Line 68 + 0x5e bytes C++
libCint.dll!Cint::G__ExceptionWrapper(int (G__value *, const char *, G__param , int) funcp, G__value * result7, char * funcname, G__param * libp, int hash) Line 393 + 0x15 bytes C++
libCint.dll!G__execute_call(G__value * result7, G__param * libp, G__ifunc_table_internal * ifunc, int ifn) Line 2390 + 0x19 bytes C++
libCint.dll!G__call_cppfunc(G__value * result7, G__param * libp, G__ifunc_table_internal * ifunc, int ifn) Line 2594 + 0x15 bytes C++
libCint.dll!G__interpret_func(G__value * result7, const char * funcname, G__param * libp, int hash, G__ifunc_table_internal * p_ifunc, int funcmatch, int memfunc_flag) Line 5254 + 0x15 bytes C++
libCint.dll!G__getfunction(const char * item, int * known3, int memfunc_flag) Line 2631 + 0x3a bytes C++
libCint.dll!G__getitem(const char * item) Line 1914 + 0x16 bytes C++
libCint.dll!G__getexpr(const char * expression) Line 1484 + 0x36 bytes C++
libCint.dll!G__exec_function() Line 644 + 0x12 bytes C++
libCint.dll!G__exec_statement() Line 7122 + 0x1c bytes C++
libCint.dll!G__interpret_func(G__value * result7, const char * funcname, G__param * libp, int hash, G__ifunc_table_internal * p_ifunc, int funcmatch, int memfunc_flag) Line 6127 + 0x13 bytes C++
libCint.dll!G__getfunction(const char * item, int * known3, int memfunc_flag) Line 2631 + 0x3a bytes C++
libCint.dll!G__getitem(const char * item) Line 1914 + 0x16 bytes C++
libCint.dll!G__getexpr(const char * expression) Line 1484 + 0x36 bytes C++
libCint.dll!G__calc_internal(const char * exprwithspace) Line 1068 + 0x10 bytes C++
libCint.dll!G__process_cmd() Line 2311 + 0x15 bytes C++
libCore.dll!TCint::ProcessLine(const char * line, TInterpreter::EErrorCode * error) Line 510 + 0x1f bytes C++
libCore.dll!TCint::ProcessLineSynch(const char * line, TInterpreter::EErrorCode * error) Line 589 + 0x1a bytes C++
libCore.dll!TApplication::ExecuteFile(const char * file, int * error, bool keep) Line 1007 + 0x34 bytes C++
libCore.dll!TApplication::ProcessFile(const char * file, int * error, bool keep) Line 883 + 0x12 bytes C++
libCore.dll!TApplication::ProcessLine(const char * line, bool sync, int * err) Line 856 + 0x2e bytes C++
libRint.dll!TRint::Run(bool retrn) Line 401 + 0x1f bytes C++
root.exe!main(int argc, char * * argv) Line 29 + 0x14 bytes C++
root.exe!__tmainCRTStartup() Line 555 + 0x19 bytes C
root.exe!mainCRTStartup() Line 371 C
kernel32.dll!76093677()
[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]
ntdll.dll!77319d42()
ntdll.dll!77319d15()
[/code]
I am pretty sure that the problem is in the definition of this containing object:
[code]#ifndef FlowSequential
#define FlowSequential
///
/// We run a sequential flow, having several guys under us
///
#include “FlowBase.h”
#include
#include
class FlowSequential :
public FlowBase
{
public:
FlowSequential(void);
~FlowSequential(void);
void InitialConfigure(TXMLNode *configNode);
/// We send this to everyone we know!
void Process(BasicPlotMaker *vars);
/// We have to create sub-folders, etc., for bookings
virtual void DoBookResults(TList *outputList, const std::string &storageDirPath);
struct FlowInfo
{
FlowBase *_flow;
std::string _name;
};
private:
std::vector _flows;
ClassDef(FlowSequential, 1);
};
#endif
[/code]
I think it has to do with _flows - but when the object is created it shoudl be empty.
Any thing obvious I’ve done wrong here? Also attached are the objects that are written out (though missing a few include files).
InputListFlat.root (4.58 KB)
iocrash.txt (19.8 KB)