problem with TTree after removing one of branches

From: Oleksandr Zenaiev <zenaiev_at_fnal.gov>
Date: Sun, 1 May 2011 05:33:33 +0200


Hello ROOTers,

I have a problem with TTree class after removing one of branches.

Here is my code (simplified enough to represent a problem):

//file: test_tree.cxx
#include "TTree.h"
#include "TBranch.h"

int main() {

	TTree* tree=new TTree("orange", "orange");
	int a;
	TBranch* br_a=tree->Branch("a", &a, "a/I");
	int b;
	TBranch* br_b=tree->Branch("b", &b, "b/I");
	for (int i=0; i<10; i++) {
		a=i;
		b=i*i;
		tree->Fill();
	}
	tree->GetListOfBranches()->Remove(br_a);
	int b1;
	tree->SetBranchAddress("b", &b1);
	return 0;

}

Then I tried to run it and got segmentation violation:


There was a crash (#7 0x0031cd8c in SigHandler ()). This is the entire stack trace of all threads:

   from /lib/ld-linux.so.2
#0 0x0086f7a2 in _dl_sysinfo_int80 () from /lib/ld-linux.so.2
#1 0x0440a7e3 in __waitpid_nocancel () from /lib/tls/libc.so.6
#2 0x043b4649 in do_system () from /lib/tls/libc.so.6
#3 0x06f8b8bd in system () from /lib/tls/libpthread.so.0
#4 0x0031a67f in TUnixSystem::Exec ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libCore.so.5.26
#5 0x0032048c in TUnixSystem::StackTrace ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libCore.so.5.26
#6 0x0031ccfe in TUnixSystem::DispatchSignals ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libCore.so.5.26
#7 0x0031cd8c in SigHandler ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libCore.so.5.26
#8 0x0031c025 in sighandler ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libCore.so.5.26
#9 <signal handler called>
#10 0x059751e3 in TTree::GetBranch ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libTree.so.5.26
#11 0x05979138 in TTree::SetBranchAddress ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libTree.so.5.26
#12 0x08048d65 in TTree::SetBranchAddress<int> ()
#13 0x08048c88 in main ()


The lines below might hint at the cause of the crash. If they do not help you then please submit a bug report at http://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.



#10 0x059751e3 in TTree::GetBranch ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libTree.so.5.26
#11 0x05979138 in TTree::SetBranchAddress ()

   from /afs/desy.de/group/zeus.zsmsm/ZEUSSysSoft/Released/Support/root/i586-sl4-linux/5.26.00/lib/libTree.so.5.26
#12 0x08048d65 in TTree::SetBranchAddress<int> ()
#13 0x08048c88 in main ()


I am using ROOT 5.26/00c (SLD, gcc 3.4.6).

Thanks in advance,
Oleksandr. Received on Sun May 01 2011 - 05:33:41 CEST

This archive was generated by hypermail 2.2.0 : Sun May 01 2011 - 11:50:01 CEST