Recovering badly closed file?

From: Brett Viren <bv_at_bnl.gov>
Date: Wed, 20 Jan 2010 13:26:26 -0500


Hi RootTalk,

I have a data file that is corrupted. This probably occurred due to an unclean shutdown of the process writing the file. Is there a way to recover any of the data?

Here is what I have tried:

I can open it with our ROOT based application ("loon" = ROOT + our libraries and data dictionaries). I then create a TFile object with it and call TFile::Recover(). This gives me:



loon [0] TFile* f = new TFile("/home/bviren/B100112_080001.mbeam.root") loon [1] f->Recover() Info in <TFile::Recover>: /home/bviren/B100112_080001.mbeam.root, recovered key TTree:BeamMon at address 167327993 (Int_t)(1)
loon [2] f->ls()
TFile**		/home/bviren/B100112_080001.mbeam.root	Persistency file
 TFile*		/home/bviren/B100112_080001.mbeam.root	Persistency file
  KEY: TTree	BeamMon;1	Persistency stream tree
  KEY: TTree	BeamMon;2161	Persistency stream tree

----------------------------------------------------------------------

Recover() produced tree "BeamMon;1". Using a TBrowser to browse either of these trees give errors of the type:



Error in <TExMap::Remove>: key 256 not found at 257 Warning in <TBufferFile::CheckObject>: reference to object of unavailable class TObject, offset=256 pointer will be 0 Error in <TExMap::Remove>: key 1356857360 not found at 274 Warning in <TBufferFile::CheckObject>: reference to object of unavailable class TObject, offset=1356857360 pointer will be 0 Error in <TExMap::Remove>: key 64 not found at 65 ...[snip]
Error in <TExMap::Remove>: key 65536000 not found at 131 Warning in <TBufferFile::CheckObject>: reference to object of unavailable class TObject, offset=65536000 pointer will be 0 Error in <TExMap::Remove>: key 1708311296 not found at 62 Warning in <TBufferFile::CheckObject>: reference to unavailable class TObject, pointers of this type will be 0 Error in <TBufferFile::CheckByteCount>: Byte count probably corrupted around buffer position 282800:

        603979859 for a possible maximum of 108 Error in <TBufferFile::CheckByteCount>: object of class TObjArray read too many bytes: 21 instead of -1471902456 Warning in <TBufferFile::CheckByteCount>: TObjArray::Streamer() not in sync with data on file /home/bviren/B100112_080001.mbeam.root, fix Streamer() Error in <TBufferFile::CheckByteCount>: Byte count probably corrupted around buffer position 282920:

        -1471902456 for a possible maximum of -29 Error in <TBufferFile::CheckByteCount>: object of class TBranch read too many bytes: 282626 instead of 282487 Warning in <TBufferFile::CheckByteCount>: TBranch::Streamer() not in sync with data on file /home/bviren/B100112_080001.mbeam.root, fix Streamer() Error in <TClass::New>: cannot create object of class TIter Segmentation fault


If it is of any use, the file is here (160 MB):

http://www.phy.bnl.gov/~bviren/root/corrupt-file/B100112_080001.mbeam.root

Thanks for any help!
-Brett. Received on Wed Jan 20 2010 - 19:26:33 CET

This archive was generated by hypermail 2.2.0 : Wed Jan 20 2010 - 23:50:01 CET