sparcityeu / SparseBase

Sparse data processing library with a generic, HPC-centric design, supports feature extraction, IO, reordering and partitioning.
https://sparcityeu.github.io/SparseBase/
MIT License
21 stars 7 forks source link

Add automated memory leak checking to tests and exampleshg #127

Open ardasener opened 2 years ago

ardasener commented 2 years ago

Our current automated testing system has no way of detecting memory leaks caused by the library. As a result, I will be adding a setting to the run_all_examples.py file which will allow the examples to be run using the valgrind tool and I will configure Github Actions to run with this setting turned on in the Ubuntu runtime.

While this is not the most complete solution, it is probably the fastest one to implement. If this turns out to be not enough, we can reconsider researching ways to integrate leak checking into Gtest.

If you disagree or have any feedback regarding this issue, feel free to comment here.

ardasener commented 2 years ago

An alternative to valgrindwould be Address Sanitizer. A particular issue with leak checking, in general, is that we might get leaks from external libraries we depend on that we can't control. So it can't be as simple as running the leak checker and checking the exit code. We might want to use a script that actually reads the output and checks the origins of the leaks.