Skip to content
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

Fix remaining memory leaks #894

Open
jesper-friis opened this issue Jul 13, 2024 · 0 comments · May be fixed by #995
Open

Fix remaining memory leaks #894

jesper-friis opened this issue Jul 13, 2024 · 0 comments · May be fixed by #995

Comments

@jesper-friis
Copy link
Collaborator

jesper-friis commented Jul 13, 2024

Running make memcheck currently shows no memory errors and 3 memory leaks:

60/120 MemCheck: #60: test_python_bindings-py ..........   Defects: 2
75/120 MemCheck: #75: test_mapping-py ..................   Defects: 1
93/120 MemCheck: #93: test_mongodb_python ..............   Defects: 1

Leak 60 is a duplicate of leak 73 and 93.

Leak 75
Require implementation of function dlite_mapping_plugin_free().
See the comment on line 104 in src/dlite-mapping.c

Leak 93
To be investigated more.
Seems that Python is not calling the destructor for StorageIterator in bindings/python/dlite-storage.i.


When these issues are fixed, and cmake --build . --target memcheck runs without failure, consider to add a GitHub CI test running cmake --build . --target memcheck for selected Python versions and platforms. However, please note that the memory checking is very slow, so it should not be run too often. Maybe periodically or only when merging to master?

Is it possible to save the log files, Testing/Temporary/MemoryChecker.<#>.log, somewhere where they can be accessed for later inspection? Alternatively make the output verbose by removing the -q option to valgrind.


For debugging, use the following command to rerun the individual tests with valgrind:

DLITE_ATEXIT_FREE= valgrind --tool=memcheck --leak-check=yes --show-leak-kinds=definite,indirect --errors-for-leak-kinds=definite --num-callers=200 --keep-debuginfo=yes --suppressions=cmake/valgrind-python.supp --suppressions=cmake/valgrind-dlite.supp --gen-suppressions=all python bindings/python/tests/test_mapping.py
@jesper-friis jesper-friis mentioned this issue Jul 13, 2024
9 tasks
@jesper-friis jesper-friis linked a pull request Oct 30, 2024 that will close this issue
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant