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
Small memory leak in sndfile-spectrogram #76
Comments
According to documenation it is false positive:
|
The interesting thing is that the documentation talks only about “still reachable” memory, which, sure, Valgrind saw plenty of that, and by default doesn’t complain about it—but the Valgrind/ On the other hand, I’m not convinced the leak is a |
How do you think, it is better to add |
I wasn’t sure. I’m still not 100% sure, but after further examination, I think that the “leaked” memory is indeed indirectly held by one of cairo’s static objects, and Valgrind can’t see the reference to it because If I’m right about that, then it is actually a false positive from Valgrind, and adding |
So, pull request? 😄 |
Ok, sure, I’ll “commit to” this solution. 😛 |
…ct in sndfile-spectrogram Certain FontConfig objects indirectly referenced via the Cairo static data are referenced by integer offsets rather than by pointers, so they appear lost to Valgrind unless we call cairo_debug_reset_static_data().
…ile-spectrogram Certain FontConfig objects indirectly referenced via the Cairo static data are referenced by integer offsets rather than by pointers, so they appear lost to Valgrind unless we call cairo_debug_reset_static_data().
When I run the tests on Fedora 34 x86_64, after applying #74 and #75, I still get a leak in
sndfile-spectrogram
.I’m not using any special build flags. (
./autogen.sh && ./configure && make -j
)A quick review of
spectrogram.c
didn’t reveal any obvious problems, nor did a quick skim through the relevant cairo internals.Adding
cairo_debug_reset_static_data()
at the end of the main routine does “fix” the leak, although I am not suggesting it as a patch.I’m reporting this in case someone else readily spots what I missed.
The text was updated successfully, but these errors were encountered: