Can't read .root file created by geant4.10.02

update ROOT software from v5.34 to v6.02
there are some errors when read the TH1D in .root file, use ROOT v6.02.

I try read data by command line “TBrowser br”, it is the same problem.
everything is OK in ROOT v5.34.

Error tips:
Root > (class TFile *) 0x50d4b30

*** Break *** segmentation violation
Generating stack trace…
0x00007fc92b1dd05d in TStreamerInfoActions::GenericReadAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) + 0x3d from /opt/root/lib/root/libRIO.so
0x00007fc92b2f32b5 in TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) + 0x75 from /opt/root/lib/root/libRIO.so
0x00007fc92b2f4fdb in TBufferFile::ReadClassBuffer(TClass const*, void*, int, unsigned int, unsigned int, TClass const*) + 0xbb from /opt/root/lib/root/libRIO.so
0x00007fc92591f12b in TH1::Streamer(TBuffer&) + 0x9b from /opt/root/lib/root/libHist.so
0x00007fc92f97fd7c in TStreamerBase::ReadBuffer(TBuffer&, char*) + 0x2c from /opt/root/lib/root/libCore.so
0x00007fc92b37c3a2 in int TStreamerInfo::ReadBuffer<char**>(TBuffer&, char** const&, TStreamerInfo::TCompInfo* const*, int, int, int, int, int) + 0x49a2 from /opt/root/lib/root/libRIO.so
0x00007fc92b1dd05d in TStreamerInfoActions::GenericReadAction(TBuffer&, void*, TStreamerInfoActions::TConfiguration const*) + 0x3d from /opt/root/lib/root/libRIO.so
0x00007fc92b2f32b5 in TBufferFile::ApplySequence(TStreamerInfoActions::TActionSequence const&, void*) + 0x75 from /opt/root/lib/root/libRIO.so
0x00007fc92b2f380e in TBufferFile::ReadClassBuffer(TClass const*, void*, TClass const*) + 0x9e from /opt/root/lib/root/libRIO.so
0x00007fc92b299a95 in TKey::ReadObj() + 0x3f5 from /opt/root/lib/root/libRIO.so
0x00007fc92b277f78 in TDirectoryFile::FindObjectAny(char const*) const + 0x208 from /opt/root/lib/root/libRIO.so
0x00007fc923e81e10 in TGFileBrowser::Clicked(TGListTreeItem*, int, int, int) + 0x6c0 from /opt/root/lib/root/libGui.so
0x00007fc92fe5f9b4 in

my code

		TFile *f2= TFile::Open(Form("%sdata/livemore/%s",dir.Data(),fname.Data()));
		if(!(f2->IsOpen())){
			cout<<"file: "<<fname<<" isn't opened!"<<endl;
			return 0;
		}
		TDirectory* dire = (TDirectory*)f2->Get("histo");
		TH1D *hSource = (TH1D*)dire->Get("source"); 
		hSource->SetDirectory(0);
		TH1D * hHPGe = (TH1D*)dire->Get("HPGe"); 
		hHPGe->SetDirectory(0);
		sourceList->Add(hSource);
		HPGeList->Add(hHPGe);

output_point_80mm.root (35.9 KB)

I have the same error. Looks like a bug in ROOT v6 :frowning: .

All ntuples are good. But “segmentation fault” comes while trying to read any histograms wrote by G4Root. Even for .root files generated by geant4 examples (basic/B4a).

Also I found that reading .root files created by a former geant4 version (10.01) will crash as same.