Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.4k
gh-120754: Fix memory leak in FileIO.__init__()#124225
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Free 'self->stat_atopen' before assigning it, sinceio.FileIO.__init__() can be called multiple times manually(especially by test_io).
vstinner commentedSep 18, 2024
cmaloney commentedSep 18, 2024
👍 Definitely where the leak is happening / my own tracking finds same location.https://vstinner.github.io/debug-python-refleak.html really helpful in tracking down, thanks for writing up. There's a number of cases where |
vstinner commentedSep 18, 2024
Only allocating (PyMem_New) You might include your better fix in a following PR if you want, since you planned more changes for io if I understood correctly. Thanks for reviewing my fix! |
cmaloney commentedSep 18, 2024 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yep, will make more PRs stat_atopen got several patches moving again.
|
Free 'self->stat_atopen' before assigning it, sinceio.FileIO.__init__() can be called multiple times manually(especially by test_io).
Uh oh!
There was an error while loading.Please reload this page.
Free 'self->stat_atopen' before assigning it, since io.FileIO.init() can be called multiple times manually (especially by test_io).