Segfault on filling a TTree

I have just compiled the new version of root 3.10.00 with g+±3.3, libc6 and linuxdeb and I cannot get past this error. The same program used to run on the earlier root 3.04.

Here are the program and the stack trace. Is the problem in that from libc6?
nt_t fun()
TFile *file = new TFile("/home/michele/data/102003/ad/SCnonlocal.root", “RECREATE”);
TTree *t = new TTree(“opto”, “”);
Float_t w;
TBranch *branch = t->Branch(“first”, &w, “w/F”);
w = 3;
delete t;
delete file;
return 0;

*** Break *** segmentation violation
Generating stack trace…
0x40fe55f8 in from /lib/
0x40643320 in G__call_cppfunc + 0x2bd from /usr/local/lib/root/
0x40631821 in G__interpret_func + 0x73f from /usr/local/lib/root/
0x4060c2f4 in G__getfunction + 0x1657 from /usr/local/lib/root/
0x40642769 in G__delete_operator + 0x317 from /usr/local/lib/root/
0x4065b091 in G__exec_delete + 0x64 from /usr/local/lib/root/
0x40661492 in G__exec_statement + 0x15b1 from /usr/local/lib/root/
0x406330a9 in G__interpret_func + 0x1fc7 from /usr/local/lib/root/
0x4060c99b in G__getfunction + 0x1cfe from /usr/local/lib/root/
0x40602c91 in G__getitem + 0x74f from /usr/local/lib/root/
0x4060144a in G__getexpr + 0x9daf from /usr/local/lib/root/
0x4065b2ca in G__exec_function + 0x1ed from /usr/local/lib/root/
0x406623a3 in G__exec_statement + 0x24c2 from /usr/local/lib/root/
0x405e70a7 in G__exec_tempfile_core + 0x33e from /usr/local/lib/root/
0x405e730b in G__exec_tempfile_fp + 0x31 from /usr/local/lib/root/
0x4066ab52 in G__process_cmd + 0x4c22 from /usr/local/lib/root/
0x4016d35e in TCint::ProcessLine(char const*, TInterpreter::EErrorCode*) + 0xaa from /usr/local/lib/root/
0x400e868a in TApplication::ProcessLine(char const*, bool, int*) + 0x5bc from /usr/local/lib/root/
0x40e6962a in TRint::HandleTermInput() + 0x132 from /usr/local/lib/root/
0x40e68359 in TTermInputHandler::Notify() + 0x27 from /usr/local/lib/root/
0x40e6ae72 in TTermInputHandler::ReadNotify() + 0x14 from /usr/local/lib/root/
0x401d847b in TUnixSystem::CheckDescriptors() + 0xfd from /usr/local/lib/root/
0x401d7c00 in TUnixSystem::DispatchOneEvent(bool) + 0xf4 from /usr/local/lib/root/
0x4013bc89 in TSystem::InnerLoop() + 0x25 from /usr/local/lib/root/
0x4013bc17 in TSystem::Run() + 0x7d from /usr/local/lib/root/
0x400e9232 in TApplication::Run(bool) + 0x30 from /usr/local/lib/root/
0x40e69168 in TRint::Run(bool) + 0x318 from /usr/local/lib/root/
0x08048e04 in main + 0x90 from /usr/local/root/bin/root.exe
0x40fd1e3e in __libc_start_main + 0xce from /lib/
0x08048cd1 in TApplicationImp::ShowMembers(TMemberInspector&, char*) + 0x35 from /usr/local/root/bin/root.exe
Root > Function fun() busy flag cleared

Hi Michele,

I don’t really know the source of your problems. I tried running the script using the following root version:


I noticed that
(a) ROOT does not like the following two commands:
delete t;
delete file;

ie.,the ROOT session would not exit, so I removed them.

(b) If I use
I cannot access the leaf contents of the output root file with a browser. If I replace it by
everything works as expected.


file->Close() is deleting your Tree. You should not delete it again.
See chapter about “Object Ownership” in the Users Guide.
In your example, you can remove the two lines
delete t;

this is automatically done by delete file.

The fact that it worked with earlier versions is just pure chance!
It is hard to predict the result of a double delete.