-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[RF][PyROOT] Fix memory leaks with RooFit command arguments in PyROOT #13594
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
[RF][PyROOT] Fix memory leaks with RooFit command arguments in PyROOT #13594
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