Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integer overflow in TTreeCache::FillBuffer #9292

Closed
SilentAssassinMa opened this issue Nov 15, 2021 · 2 comments · Fixed by #14818
Closed

Integer overflow in TTreeCache::FillBuffer #9292

SilentAssassinMa opened this issue Nov 15, 2021 · 2 comments · Fixed by #14818

Comments

@SilentAssassinMa
Copy link

Describe the bug

The TTree::SetCacheSize() method takes 64-byte integer as input, however the types of member fBuffer and fBufferMin in class TTreeCache are both 32-byte integer, so there will be an integer overflow if one tries to set the buffer size more than 512MB because in the line 1614 of TTreeCache.cxx:

if (ntotCurrentBuf > 4 * fBufferSizeMin) 
// Humm something wrong happened.
                  Warning("FillBuffer", "There is more data in this cluster (starting at entry %lld to %lld, "
                                        "current=%lld) than usual ... with %d %.3f%% of the branches we already have "
                                        "%d bytes (instead of %d)",
                          fEntryCurrent, fEntryNext, entries[j], i, (100.0 * i) / ((float)fNbranches), ntotCurrentBuf,
                          fBufferSizeMin);

so one will get weird warnings like:

Warning in <TTreeCache::FillBuffer>: There is more data in this cluster (starting at entry 0 to 34020, current=31185) than usual ... with 700 42.067% of the branches we already have 458967692 bytes (instead of 1073741824)

even though every thing is fine.

@ferdymercury
Copy link
Contributor

I proposed a PR

Copy link

github-actions bot commented Apr 9, 2024

Hi @pcanal,

It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise.

Sincerely,
🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants