[RF][PyROOT] Fix memory leaks with RooFit command arguments in PyROOT#13594
[RF][PyROOT] Fix memory leaks with RooFit command arguments in PyROOT#13594guitargeek wants to merge 1 commit intoroot-project:masterfrom
Conversation
PyROOT is wrongly interpreting the signature of `RooLinkedList::Add(RooAbsArg *arg)` as the RooLinkedList taking ownership of the RooAbsArg. This results in a memory leak because nobody feels responsible for deleting the arg. This can be fixed by setting the memory policy of the method to "strict" and not to "heuristic" in the pythonizations. This pythonization might become unnecessary in the future if it is decided to set the global memory policy to "strict" in _facade.py. Reproducer of the original problem: the first code snippet in this forum post: https://root-forum.cern.ch/t/memory-leak-in-fits/56249
|
Starting build on |
|
Build failed on ROOT-ubuntu2204/nortcxxmod. Failing tests: |
|
Build failed on ROOT-ubuntu2004/python3. Failing tests: |
|
Build failed on windows10/default. Failing tests: |
|
Build failed on mac11/noimt. Failing tests: |
|
Build failed on ROOT-performance-centos8-multicore/soversion. Failing tests:
And 43 more |
|
Closing in favor of the proper fix: |
PyROOT is wrongly interpreting the signature of
RooLinkedList::Add(RooAbsArg *arg)as the RooLinkedList taking ownership of the RooAbsArg. This results in a memory leak because nobody feels responsible for deleting the arg. This can be fixed by setting the memory policy of the method to "strict" and not to "heuristic" in the pythonizations.This pythonization might become unnecessary in the future if it is decided to set the global memory policy to "strict" in _facade.py.
Reproducer of the original problem: the first code snippet in this forum post:
https://root-forum.cern.ch/t/memory-leak-in-fits/56249
This PR is only a hot-fix to the problem. The more sustainable solution will be provided by another PR that disables the heuristic memory management:
#13593