Problem: close TFile

void StoreData::CloseRootFile()
{
hfile->Write();
hfile->Close();
}

Hi, I have a problem with a method CloseRootFile():
same time, when I call this method the program crashes.

I don’t understand why… any idea?
thanks

The error message is:

*** Break *** segmentation violation

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

#0 0x00007f94bd40943e in waitpid () from /lib/x86_64-linux-gnu/libc.so.6
#1 0x00007f94bd38f29e in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#2 0x00007f94c03298b7 in TUnixSystem::StackTrace() () from /home/daqmgr/Software/root/lib/libCore.so
#3 0x00007f94c032c193 in TUnixSystem::DispatchSignals(ESignals) () from /home/daqmgr/Software/root/lib/libCore.so
#4
#5 0x00007f94bd3d1606 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#6 0x00007f94bf8c7571 in G__defined_tagname () from /home/daqmgr/Software/root/lib/libCint.so
#7 0x00007f94c02ed3d1 in TCint::CheckClassInfo(char const*, bool) () from /home/daqmgr/Software/root/lib/libCore.so
#8 0x00007f94c02ffee8 in TClass::Init(char const*, short, std::type_info const*, TVirtualIsAProxy*, void ()(void, TMemberInspector&), char const*, char const*, int, int, bool) () from /home/daqmgr/Software/root/lib/libCore.so
#9 0x00007f94c0300523 in TClass::TClass(char const*, short, std::type_info const&, TVirtualIsAProxy*, void ()(void, TMemberInspector&), char const*, char const*, int, int, bool) () from /home/daqmgr/Software/root/lib/libCore.so
#10 0x00007f94c03006c8 in ROOT::CreateClass(char const*, short, std::type_info const&, TVirtualIsAProxy*, void ()(void, TMemberInspector&), char const*, char const*, int, int) () from /home/daqmgr/Software/root/lib/libCore.so
#11 0x00007f94c030da91 in ROOT::TGenericClassInfo::GetClass() () from /home/daqmgr/Software/root/lib/libCore.so
#12 0x00007f94be8d03f9 in TTree::Class() () from /home/daqmgr/Software/root/lib/libTree.so
#13 0x00007f94bf3cecd9 in TKey::TKey(TObject const*, char const*, int, TDirectory*) () from /home/daqmgr/Software/root/lib/libRIO.so
#14 0x00007f94bf3abb1a in TFile::CreateKey(TDirectory*, TObject const*, char const*, int) () from /home/daqmgr/Software/root/lib/libRIO.so
#15 0x00007f94bf3a3560 in TDirectoryFile::WriteTObject(TObject const*, char const*, char const*, int) () from /home/daqmgr/Software/root/lib/libRIO.so
#16 0x00007f94c02821c5 in TObject::Write(char const*, int, int) const () from /home/daqmgr/Software/root/lib/libCore.so
#17 0x00007f94bf3a17aa in TDirectoryFile::Write(char const*, int, int) () from /home/daqmgr/Software/root/lib/libRIO.so
#18 0x00007f94bf3ace13 in TFile::Write(char const*, int, int) () from /home/daqmgr/Software/root/lib/libRIO.so
#19 0x000000000040b68f in StoreData::CloseRootFile (this=0xa78400) at src/myfile1.cxx:121
#20 0x0000000000408d74 in ReadFile::readata (this=0x7f94c0c40010) at src/myfile2.cxx:66
#21 0x00000000004085a4 in main (argc=3, argv=0x7fff4d21c048) at main.cxx:94

The lines below might hint at the cause of the crash.
If they do not help you then please submit a bug report at
root.cern.ch/bugs. Please post the ENTIRE stack trace
from above as an attachment in addition to anything else
that might help us fixing this issue.

#5 0x00007f94bd3d1606 in ?? () from /lib/x86_64-linux-gnu/libc.so.6

Warning in : The rule for class: “TTree”: version, “[-16]” and data members: “fDefaultEntryOffsetLen” has been skipped because the target member (fDefaultEntryOffsetLen) is unknown.

Warning in : The rule for class: “TTree”: version, “[-18]” and data members: “fNClusterRange” has been skipped because the target member (fNClusterRange) is unknown.

Hi,
But what are you doing before?
Are you reading data from this file or just want to save data to this file, and what is kind of those data?

Hi,

This problem seems pretty odd. Are you sure you are building, linking and running against the same version of ROOT (i.e. try rebuilding from scratch)? If this does not solve the problem I recommend running with valgrind to pin-point the origin of the problem.

Cheers,
Philippe.