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
Python cApi memory problem. Py_Initialize memory leak #64092
Comments
I wrote small test program using Python cApi, and found some memory issues while working on it. I checked it with valgrind. (test code and valgrind output appended) |
Did you use --suppressions=Misc/valgrind-python.supp? |
Also, you have zero "definitely lost". "possibly lost" is not |
I didn't use --suppressions=Misc/valgrind-python.supp before . (But I've done it now). Nothing important has changed. |
Did you compile Python --with-valgrind? |
I've just done it. Python 3.3.3 --with-valgrind. I can't see the difference. Output appended. |
You shoud configure --with-valgrind *and* use the suppression list, or Victor |
I compiled python --with-valgrind --without-pymalloc, and used valgrind with suppressions. valgrind --suppressions=../Misc/valgrind-python.supp --leak-check=full --show-reachable=no --show-possibly-lost=no --track-origins=yes --log-file=vgrindNext.out ./test |
Sorry, but I still don't understand this issue. "Invalid read of size 4" is a known false positive. It can be worked around using ./configure --with-valgrind and the suppression list, or using ./configure --without-pymalloc. If you still get the warning, you used the wrong options or you are still using another Python binary (or shared library). Make sure that you are linked to your newly compiled shared library. "valgrind --leak-check=full --log-file=valgrind.log ./python -c pass" shows me "possibly lost: 286,779 bytes in 654 blocks". This is also another known issue: Python doesn't release all the memory at exit, they are many "singletons" and variables initialized once but never released. The PEP-3121 helps this issue but the PEP is not fully implemented yet, many modules should still be modified. So what is your question? Do you think that Python leaks memory? Why do you think so? |
I've checked it one more time. Now I belive that everything with memory is ok. Thank you very much for your help. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: