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

Test for memory leaks #39

Open
alecandido opened this issue Jun 24, 2024 · 3 comments
Open

Test for memory leaks #39

alecandido opened this issue Jun 24, 2024 · 3 comments
Labels

Comments

@alecandido
Copy link
Member

Since we're exposing a C API, and we'll have examples for its usage, we should not only test for the absence of errors while running, but even the possible memory leaks, using tools like Valgrind (possibly in the CI).

@alecandido
Copy link
Member Author

Related to #38

@scarrazza
Copy link
Member

We could use the compiler address sanitize option (-fsanitize=address). Usually, this is quite useful and simple to catch memory leaks when executing tests.

@alecandido
Copy link
Member Author

alecandido commented Jun 25, 2024

Address sanitization is not the only one (I didn't know even that), and the other ones seem also pretty useful:
https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html
e.g. -fsanitize=leak (particularly relevant for this issue).

However, here is a brief comparison with Valgrind:
https://stackoverflow.com/a/47261999/8653979

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants