Skip to content
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

bpo-44116: Add GC support to _csv heap types #26074

Merged
merged 4 commits into from
May 12, 2021

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented May 12, 2021

  • Implement full GC protocol support for _csv heap types
  • Use tp_clear iso. tp_finalize to clear type contexts

Petr's reproducer now outputs the following:

$ ./python.exe bug.py
73166
73168
73168
73168
73168
73168
73166
73168
73168
73168

However, the _csv test suite now leaks (EDIT: updated output after b8772d6)
UPDATE: No leaks after 19e2952

https://bugs.python.org/issue44116

@erlend-aasland
Copy link
Contributor Author

(I'm applying skip news to this, @pablogsal (@corona10), as it is similar to GH-26072.)

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Some minor nits below:

Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Outdated Show resolved Hide resolved
@erlend-aasland erlend-aasland marked this pull request as ready for review May 12, 2021 16:55
@Fidget-Spinner
Copy link
Member

Doh I should've refreshed before I submitted the review. Didn't see your latest commits :(. Sorry.

@erlend-aasland
Copy link
Contributor Author

Doh I should've refreshed before I submitted the review. Didn't see your latest commits :(. Sorry.

No problem, Ken :) I believe all your comments were addressed in 19e2952.

@erlend-aasland erlend-aasland changed the title [WIP] bpo-44116: Add GC support to _csv heap types bpo-44116: Add GC support to _csv heap types May 12, 2021
Modules/_csv.c Outdated Show resolved Hide resolved
Modules/_csv.c Outdated Show resolved Hide resolved
@pablogsal
Copy link
Member

One thing that I don't understand is why the CSV tests when executed under the refleak checker don't show any problems

@pablogsal
Copy link
Member

Does this need backport to 3.9?

@pablogsal pablogsal merged commit e5ba1fe into python:main May 12, 2021
@miss-islington
Copy link
Contributor

Thanks @erlend-aasland for the PR, and @pablogsal for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-26081 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label May 12, 2021
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 12, 2021
(cherry picked from commit e5ba1fe)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
@erlend-aasland erlend-aasland deleted the gc-csv branch May 12, 2021 18:21
@erlend-aasland
Copy link
Contributor Author

Does this need backport to 3.9?

No. This was added in December in GH-23224

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented May 12, 2021

Thanks for reviewing, Pablo and Ken!

pablogsal pushed a commit that referenced this pull request May 12, 2021
@encukou
Copy link
Member

encukou commented May 12, 2021

Thank you for pushing this through!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants