R__unzip_header: error

I have a root file created with root 6.18/04
I can use this file and Draw any quantities with the command line without problems
When trying to loop on Entries I get a lot (but not for every entries) messages:

Error R__unzip_header: error in header.  Values: 064
Error in <TBasket::ReadBasketBuffers>: Inconsistency found in header (nin=0, nbuf=0)
Error in <TBasket::ReadBasketBuffers>: fNbytes = 111, fKeylen = 75, fObjlen = 1656, noutot = 0, nout=0, nin=0, nbuf=0

In this file there is a unusual branch that could be the case of the problem but
a Draw using this branch show no problems and no messages.

*Br    6 :waveform  : waveform[148400]/s                                     *
*Entries :13250 : Total  Size= 3932638838 bytes  File Size  = 1884413502 *
*Baskets :      397 : Basket Size=   25600000 bytes  Compression=   2.09     *

Please read tips for efficient and successful posting and posting code

_ROOT Version: 6.04
_Platform: linux
_Compiler: linuxx8664gcc

Hi @produit,
do I understand correctly that you are reading a file produced with ROOT v6.18 with ROOT v6.04? That’s a very old ROOT version, could that be causing of the problem? E.g. can you read the file correctly with a recent ROOT version on lxplus?


I am using 6.18/04 for both writing and reading.
Sorry for the confusion.

produit@yoga2$ root
  | Welcome to ROOT 6.18/04                  https://root.cern |
  |                               (c) 1995-2019, The ROOT Team |
  | Built for linuxx8664gcc on Dec 05 2019, 16:25:00           |
  | From tags/v6-18-04@v6-18-04                                |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q' |

No problem, then I think we need @pcanal 's help.

It might be useful to get our hands on even just one event that causes this problem, would you be able to share that with us?


I sent you the file and a piece of code to create the
message by private message

Have you received the file and are you able to reproduce the problem?

I have not worked on this since Friday afternoon, sorry.
I’m still hoping @pcanal could comment, because I’m not sure what could cause messages like

Error R__unzip_header: error in header.  Values: 064
Error in <TBasket::ReadBasketBuffers>: Inconsistency found in header (nin=0, nbuf=0)
Error in <TBasket::ReadBasketBuffers>: fNbytes = 111, fKeylen = 75, fObjlen = 1656, noutot = 0, nout=0, nin=0, nbuf=0


UPDATE: your reproducer works though!

Some of the basket of the branch “ped_id” are in corrupted part of the file.

The difference between the “no warning printed” and “warning printed” case lay in

   int n = t->GetEntries();
   for (int i = 0; i < n; i++) {

reads all the branches even-though you only need/access two.
In contrast TTree::Draw will read only the branches needed.
You can try RDF or the following tweak on your code:

   UShort_t waveform[148400];
   TBranch *waveform_b = nullptr;
   t->SetBranchAddress("waveform", waveform, &waveform_b);
   UInt_t trigger_time_s;
   TBranch *trigger_time_s_b = nullptr;
   t->SetBranchAddress("trigger_time_s", &trigger_time_s, &trigger_time_s_b);
   UInt_t trigger_time_qns;
   TBranch *trigger_time_qns_b;
   t->SetBranchAddress("trigger_time_qns", &trigger_time_qns, &trigger_time_qns_b);
   int n = t->GetEntries();
   for (int i = 0; i < n; i++) {
      Long64_t local_entry = t->LoadEntry(i); // returns the local entry number of the current tree in branch.

(technically you only need the last 2 entry if at least one of the element of the waveform array for the current entry passes the cut.)


1 Like

Hi Philippe,
thanks a lot.
The question now is why this file is corrupted in the first place.
This file is created using root 6.18/04.
I can recreate the file and reproduce the problem so it is not something due to after the fact file
corruption. So how come can we create a corrupted file.
It is possible that the program that write the file has a bug but I don’t know exactly what I have to look for. At least there are no compiler warnings nor messages during execution.
You said the problem is in the ped_id branch, I can try to see if there is something special with this branch.
The program that create the file is a very generic program that transform file in ZFITS format into ROOT
so it is very general so not easy to make something smaller that reproduce the creation problem.
But I can 100% reproduce the problem in converting a particular ZFITS file using this program

Humm … that is a ‘disaster’ … I will take another look and try to see if I can infer anything from the way the baskets are corrupted.

In the meantime, can you run the failing producer with valgrind --suppressions=$ROOTSYS/etc/valgrind-root.supp .... and see if anything pop out.

The next step will be for me to run the failing producer and debug it …

Looking at the error more carefully, it looks like the problem is “only” the 2nd basket of the “ped_id” branch. Specifically it appears to be a compression problem. It is possible (but not guaranteed) that the basket compression failed and the raw data was stored (uncompressed) but marked as being compressed.

Either way, since this is reproducible and happening exactly once, with the reproducer and a debug version of ROOT we ought to be able to understand the problem.


tell me how do we proceed to debug that.
You can contact me in private.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.