Out of memory when ROOT does not have permission to write to a directory

Hi all,

No code here, but I am wondering about some behavior I observed.

I have a compiled program which uses ROOT - the actual content of the program is not particularly important to the behavior, but it reads from a TTree, generates some random numbers on top of the TTree, and writes the new TTree to file.

Normally, when calling TTree::Fill, the basket is flushed at 32k of memory usage. However, it looks to me like when the program does not have permission to write to a certain file, the basket is never flushed, and data is held in memory indefinitely. No error is generated for being unable to access/write to the file.

When this happens, eventually I run out of memory and the process is killed by the kernel.

When I execute the program with a directory to which it has permissions to write, everything works fine, and memory usage stays low.

I’ve resolved the issue by changing the permissions of the directory, but now I am curious if this is the expected behavior. Could an error message/exception be added, or is there some reason (either due to C++ or ROOT) that it can’t?

Thanks!

ROOT Version: 6.22
Platform: Ubuntu 22.04 LTS
Compiler: g++


Try:

TFile *f = TFile::Open("/cannot/write/file.root", "recreate");
if (!f || f->IsZombie()) { std::cout << "ERROR\n"; return; }