I have created root ntuples with root_5_22 in one linux box. Then I moved them to Fedora 8 which has root_5_22 (same version). When I draw some variables with cuts I got following errors (there was no error when I did the same thing, run the same code, in old linux box):
R__unzip: error -3 in inflate (zlib)
Error in TBasket::ReadBasketBuffers: fNbytes = 29684, fKeylen = 90, fObjlen = 31908, noutot = 0, nout=0, nin=29594, nbuf=31908
…
…
Error in TBasket::ReadBasketBuffers: fNbytes = 29684, fKeylen = 90, fObjlen = 31908, noutot = 0, nout=0, nin=29594, nbuf=31908
terminate called after throwing an instance of 'std::bad_alloc’
what(): St9bad_alloc
Abort
…
What could be the reason?
The files may be corrupted in different ways
-critical info like directory info, Tree header, etc overwritten ->File is unusable
-only some baskets are overwritten
When connecting a root file with
TFile f(“myfile.root”);
if you have the 1st type of error, ROOT will complain immediately
if you have the 2nd type, you will see the problem only when reading the branch buffers.
You can test the second case by doing
f.Map();
this will list all blocks in the file. if something goes wrong, the Mp function will tell you where.
Note that files may be corrupted just by copying files from one system to another or if your file system has a problem.