# TBasket Problem in root

**URL:** <https://root-forum.cern.ch/t/tbasket-problem-in-root/28313>\
**Category:** ROOT\
**Created:** [March 14, 2018, 12:19pm UTC](https://root-forum.cern.ch/t/tbasket-problem-in-root/28313 "2018-03-14T12:19:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prasant](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ea666f/32.png) [@Prasant](https://root-forum.cern.ch/u/Prasant)\
**Post date:** [March 14, 2018, 12:19pm UTC](https://root-forum.cern.ch/t/tbasket-problem-in-root/28313/1 "2018-03-14T12:19:32Z")

</div>

Please provide the following information:  
ROOT Version (e.g. 6.12/02):  
Platform, compiler (e.g. CentOS 7.3, gcc6.2):

I am getting this error.  
Error in TBasket::ReadBasketBuffers: fNbytes = 910402, fKeylen = 82, fObjlen = 1024152, noutot = 0, nout=0, nin=910320, nbuf=1024152  
file probably overwritten: stopping reporting error messages  
===\>File is more than 2 Gigabytes  
R\_\_unzip: error -5 in inflate (zlib)  
Error in TBasket::ReadBasketBuffers: fNbytes = 910402, fKeylen = 82, fObjlen = 1024152, noutot = 0, nout=0, nin=910320, nbuf=1024152  
R\_\_unzip: error -5 in inflate (zlib)

Can somebody have a look into it ? I don’t understand the error.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [March 14, 2018, 7:19pm UTC](https://root-forum.cern.ch/t/tbasket-problem-in-root/28313/2 "2018-03-14T19:19:13Z")

</div>

It looks like the file is corrupted. It may not have been closed properly when writing or the byte on disk got corrupted.

---

<div class="post-metadata">

**Author:** ![Prasant](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ea666f/32.png) [@Prasant](https://root-forum.cern.ch/u/Prasant)\
**Post date:** [March 15, 2018, 10:08am UTC](https://root-forum.cern.ch/t/tbasket-problem-in-root/28313/3 "2018-03-15T10:08:16Z")

</div>

Okay…Thanks. Actually In my input file there are 80 milion signal events and 60 milion background events. I am reading the events from the input tree file by a for loop and doing some caluculations with the variables. Then, I am creating a new tree file and putting those variables in it. All the events of the Input file and the newly created tree file are of same.  
While the code is running, It is giving this error.

What is going wrong in this process. I was suspecting, there is some memory issue.

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [March 15, 2018, 2:27pm UTC](https://root-forum.cern.ch/t/tbasket-problem-in-root/28313/4 "2018-03-15T14:27:15Z")

</div>

> While the code is running, It is giving this error.

It still could be a corrupted file. To exclude this possibility, just write a small example that ‘just’ loop over the entries and call GetEntry, if that works then the file is fine.

> What is going wrong in this process. I was suspecting, there is some memory issue.

You could run your failing example under valgrind with the option --suppressions=$ROOTSYS/etc/valgrind-root.supp and it might give you more information if the problem is ‘memory corruption’.

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![Prasant](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/p/ea666f/32.png) [@Prasant](https://root-forum.cern.ch/u/Prasant)\
**Post date:** [March 15, 2018, 3:28pm UTC](https://root-forum.cern.ch/t/tbasket-problem-in-root/28313/5 "2018-03-15T15:28:41Z")

</div>

Okay…thanks again.  
I forgot to mention one thing. The code is running fine, when I am reading small number of signal and background events, (let’s say 40 milion signal and 30 milion backgrund) out of all events. As you said, the file might be corrupted. I am looking ito it.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 29, 2018, 3:28pm UTC](https://root-forum.cern.ch/t/tbasket-problem-in-root/28313/6 "2018-03-29T15:28:43Z")

</div>

Closed on March 29, 2018, 3:28pm UTC

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