Skip to content

Fix memory leak in SCTRawContByteStreamCnv

Triggered by https://its.cern.ch/jira/browse/ATR-29034, I noticed the memory leak in SCTRawContByteStreamCnv.

Current main:

> valgrind --show-possibly-lost=no --smc-check=all --tool=memcheck --leak-check=full --num-callers=30 --log-file=valgrind.%p.%n.out --track-origins=yes python -m SCT_RawDataByteStreamCnv.testSCTEncodeNewConf
> grep "definitely lost:" valgrind.3070347.1.out
==3070347==    definitely lost: 205,024 bytes in 1,456 blocks
> grep -C 2 "SCTRawContByteStreamCnv" valgrind.3070347.1.out
==3070347== 2,640 bytes in 10 blocks are definitely lost in loss record 27,304 of 29,208
==3070347==    at 0x484AF01: operator new(unsigned long) (vg_replace_malloc.c:434)
==3070347==    by 0x9B358DF9: SCTRawContByteStreamCnv::createRepConst(DataObject*, IOpaqueAddress*&) const (SCTRawContByteStreamCnv.cxx:62)
==3070347==    by 0x3279D1E4: AthCnvSvc::makeCall(int, bool, bool, bool, IOpaqueAddress*&, DataObject*&) (AthCnvSvc.cxx:590)
==3070347==    by 0x3279D45F: virtual thunk to AthCnvSvc::createRep(DataObject*, IOpaqueAddress*&) (AthCnvSvc.h:183)

With this MR:

> valgrind --show-possibly-lost=no --smc-check=all --tool=memcheck --leak-check=full --num-callers=30 --log-file=valgrind.%p.%n.out --track-origins=yes python -m SCT_RawDataByteStreamCnv.testSCTEncodeNewConf
> grep "definitely lost:" valgrind.3130953.1.out
==3130953==    definitely lost: 199,432 bytes in 1,434 blocks
> grep -C 2 "SCTRawContByteStreamCnv" valgrind.3130953.1.out
>
Edited by Maciej Pawel Szymanski

Merge request reports