Memory leak: TProofLite::MakeQueryResult

I’m chasing down memory leaks in my code, which is designed to iterate a certain type of data processing on the same data many times. Pseudocode:

TProof* plite
TChain* data
TSelector* myselector
MyClass* myc
plite->AddInput(myc)
data->Process(myselector)
myc->PrepareForReprocess()
data->Process(myselector)
Prepare()/Process()/Prepare()/Process() etc.

MyClass holds parameters determined by one pass through the data that influence how the next pass should go.

I’ve got a memory leak reported by Valgrind’s memcheck, that doesn’t seem to directly reference my selector or my input class. The specific section I have in mind is below, and attached is the full memcheck log.

==17804== 351,786,988 (2,128 direct, 351,784,860 indirect) bytes in 7 blocks are definitely lost in loss record 65,306 of 65,306 ==17804== at 0x4A076A5: operator new(unsigned long) (in /opt/rh/devtoolset-2/root/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==17804== by 0x4DE2575: TStorage::ObjectAlloc(unsigned long) (in /usr/local/root_v5.34.21/lib/root/libCore.so) ==17804== by 0xD3ADEBA: TProofLite::MakeQueryResult(long long, char const*, long long, TDSet*, char const*) (in /usr/local/root_v5.34.21/lib/root/libProof.so) ==17804== by 0xD3B7024: TProofLite::Process(TDSet*, char const*, char const*, long long, long long) (in /usr/local/root_v5.34.21/lib/root/libProof.so) ==17804== by 0xD376CB3: TProof::Process(TDSet*, TSelector*, char const*, long long, long long) (in /usr/local/root_v5.34.21/lib/root/libProof.so) ==17804== by 0xCBB57F7: G__ManualTree2_119_0_147(G__value*, char const*, G__param*, int) (in /usr/local/root_v5.34.21/lib/root/libTree.so) ==17804== by 0x583CB78: Cint::G__ExceptionWrapper(int (*)(G__value*, char const*, G__param*, int), G__value*, char*, G__param*, int) (in /usr/local/root_v5.34.21/lib/root/libCint.so) ==17804== by 0x584F549: G__exec_asm (in /usr/local/root_v5.34.21/lib/root/libCint.so) ==17804== by 0x5914DEF: G__exec_loop(char const*, char*, std::list<G__FastAllocString, std::allocator<G__FastAllocString> > const&) [clone .clone.0] (in /usr/local/root_v5.34.21/lib/root/libCint.so) ==17804== by 0x590FB3A: G__exec_statement (in /usr/local/root_v5.34.21/lib/root/libCint.so) ==17804== by 0x58BF2E4: G__interpret_func (in /usr/local/root_v5.34.21/lib/root/libCint.so) ==17804== by 0x58ABCCA: G__getfunction (in /usr/local/root_v5.34.21/lib/root/libCint.so)

Does anyone know where I can begin in tracking down this leak?

Thank you!
log.txt (747 KB)

Hello,

I think I have fixed a possible cause in the master and v5-34-00-patches branch.
Any possibility to give a try?

G. Ganis

Thank you for looking into the problem!

I’m not the sysadmin for my machine, so it may take me a few days to try and get the right version installed to check.

Forgive my inexperience, but I’ve never installed an in-development version of ROOT before. Is there a guide for beginners in grabbing the right version?