Skip to content

Conversation

@guitargeek
Copy link
Contributor

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

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
@phsft-bot
Copy link

Starting build on ROOT-performance-centos8-multicore/soversion, ROOT-ubuntu2204/nortcxxmod, ROOT-ubuntu2004/python3, mac11/noimt, mac12arm/cxx20, windows10/default
How to customize builds

@phsft-bot
Copy link

Build failed on ROOT-ubuntu2204/nortcxxmod.
Running on root-ubuntu-2204-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link

Build failed on ROOT-ubuntu2004/python3.
Running on root-ubuntu-2004-1.cern.ch:/home/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link

Build failed on windows10/default.
Running on null:C:\build\workspace\root-pullrequests-build
See console output.

Failing tests:

@phsft-bot
Copy link

Build failed on mac11/noimt.
Running on macphsft20.dyndns.cern.ch:/Users/sftnight/build/workspace/root-pullrequests-build
See console output.

Failing tests:

@github-actions
Copy link

github-actions bot commented Sep 4, 2023

Test Results

       10 files         10 suites   1d 23h 46m 28s ⏱️
  2 483 tests      503 ✔️   0 💤 1 980
23 771 runs  20 966 ✔️ 41 💤 2 764

For more details on these failures, see this check.

Results for commit 93c07b3.

@guitargeek
Copy link
Contributor Author

Closing in favor of the proper fix:

@guitargeek guitargeek closed this Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants