-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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 lists memory leaks: dlopen() called without dlclose() #121096
Comments
AFAICT, Is there a callback mechanism for (extension) modules that could be called in order to close the handle when needed? As for "how", you need to carry over the handle in the module objects probably... |
I don't think that it does exist, and it would require to rewrite a lot of things. For now, I prefer to simply ignore ("suppress") the "leak" in Valgrind. |
…ythonGH-121097) (cherry picked from commit 6e63d84) Co-authored-by: Victor Stinner <vstinner@python.org>
…ythonGH-121097) (cherry picked from commit 6e63d84) Co-authored-by: Victor Stinner <vstinner@python.org>
Example on Python 3.12 when loading
_crypt
extension module:Valgrind reports leaks on memory allocated by
dlopen()
inPython/dynload_shlib.c
, because Python doesn't calldlclose()
.I don't think that it's big deal to not call
dlclose()
, since there is little memory and it's not common to unload a dynamic library at runtime. Also, I don't see where/howdlclose()
can be called.Instead, I propose to suppress these warnings in the Valgrind suppressions file, to help spotting more important leaks.
Linked PRs
The text was updated successfully, but these errors were encountered: