-
Notifications
You must be signed in to change notification settings - Fork 19
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
Valgrind reports a memory leak. #24
Comments
On Mon, Jan 01, 2024 at 02:39:44PM -0800, Bruno Bernard wrote:
here is the full report:
```
valgrind --leak-check=full ./ndb search --limit 2 --oldest-first 'nosy ostrich'
==90548== at 0x484DA83: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==90548== by 0x11635B: ndb_init (nostrdb.c:3222)
==90548== by 0x10E557: main (ndb.c:133)
```
The memory leak is negligible but it would be nice to add some kind of report in case of memory leak in the CI.
how does valgrind determine leaks in this case? of course this is
leaking because free only happens on ndb_destroy.
|
While reading the code, I saw that. But Valgrind spits the memory leaks as it sees it happening during the execution. Even if memory is freed at the end using Also, it is negligible. 280 Bytes ¯_(ツ)_/¯ |
On Mon, Jan 01, 2024 at 03:46:06PM -0800, Bruno Bernard wrote:
While reading the code, I saw that. But Valgrind spits the memory leaks
as it sees it happening during the execution. Even if memory is freed
at the end using `ndb_destroy`. _Maybe_ a proper fix would be to free
the memory right after it is no longer needed. What do you think
instead of waiting at the end.
That wouldn't make any sense. Everything is needed in ndb until the
database is closed.
|
I agree, but I think it's something related with the calloc. Rather than the ndb itself. I can close the issue. But it would be nice to have some kind of memory leak checker in the CI. What do you think ? |
On Tue, Jan 02, 2024 at 03:34:40AM -0800, Bruno Bernard wrote:
I agree, but I think it's something related with the calloc. Rather
than the ndb itself. I can close the issue. But it would be nice to
have some kind of memory leak checker in the CI. What do you think ?
yeah for sure, ideally without these false positives.
|
Valgrind has some suppression features. I will push it for the CI, when I have some time |
here is the full report:
The memory leak is negligible but it would be nice to add some kind of report in case of memory leak in the CI.
The text was updated successfully, but these errors were encountered: