Error in <TBufferFile::CheckByteCount>: object of class TObjArray read too many bytes

When I try to read a 266 MB root file and get the TTree, I run into the following error message below. Any idea what is going on here? I thought that the maximum file size that could be read was at least 1GB.

I am reading the file with version 6.24/02 and the file was created using version 6.20/04.

Error in <TBufferFile::CheckByteCount>: object of class TObjArray read too many bytes: 1074157674 instead of 415850
Warning in <TBufferFile::CheckByteCount>: TObjArray::Streamer() not in sync with data on file data_1331.root, fix Streamer()
Error in <TExMap::Remove>: key 192 not found at 194
Warning in <TBufferFile::CheckObject>: reference to object of unavailable class TObject, offset=192 pointer will be 0
Error in <TExMap::Remove>: key 87228416 not found at 48666
Warning in <TBufferFile::CheckObject>: reference to object of unavailable class TObject, offset=87228416 pointer will be 0
Error in <TExMap::Remove>: key 1331 not found at 1332
Warning in <TBufferFile::CheckObject>: reference to object of unavailable class TObject, offset=1331 pointer will be 0
Error in <TExMap::Remove>: key 16777216 not found at 4379
Warning in <TBufferFile::CheckObject>: reference to object of unavailable class TObject, offset=16777216 pointer will be 0

ROOT Version: 6.24/02
Platform: Ubuntu 20.04.6
Compiler: gcc 9.4.0


Could you try with 6.32/02 and see if the error message is the same or it changed?

1 Like

I tried in 6.32/02 and got the exact same error message.

The file might be corrupt? Does it open well in 6.20?
If you share it in an online link i can take a look

1 Like

I haven’t tried opening it in 6.20. The file was generated by a collaborator. I assume they used 6.20 since TFile::GetVersion returns the value 62004.

Here is a Dropbox folder containing the problem file: Dropbox

Many thanks for taking a look at this.

I took a look.
I tried with 6.20 and it also crashes.

My hypothesis is that this file was generated with a ROOT version that had an ‘overflow’ bug in the code (that was recently solved in 6.32), so the file ended up being corrupt.

Adding @pcanal in the loop.