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

gh-121390: tracemalloc: Fix tracebacks memory leak #121391

Merged
merged 1 commit into from
Jul 5, 2024

Conversation

jbrobst
Copy link
Contributor

@jbrobst jbrobst commented Jul 5, 2024

The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
Copy link

cpython-cla-bot bot commented Jul 5, 2024

All commit authors signed the Contributor License Agreement.
CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Jul 5, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@bedevere-app
Copy link

bedevere-app bot commented Jul 5, 2024

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

@gaogaotiantian
Copy link
Member

As far as I can tell, this is a typo introduced in 5b0a303. @vstinner could you confirm? @jbrobst thanks for noticing this. This is a small fix but it still has some level of user observable behavior change (memory is not leaking). Could you do a news entry?

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM

@vstinner vstinner added skip news needs backport to 3.12 bug and security fixes needs backport to 3.13 bugs and security fixes labels Jul 5, 2024
@vstinner vstinner merged commit db39bc4 into python:main Jul 5, 2024
39 checks passed
@miss-islington-app
Copy link

Thanks @jbrobst for the PR, and @vstinner for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 5, 2024
…1391)

The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
(cherry picked from commit db39bc4)

Co-authored-by: Josh Brobst <jbrobst@proton.me>
@bedevere-app
Copy link

bedevere-app bot commented Jul 5, 2024

GH-121392 is a backport of this pull request to the 3.13 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 5, 2024
…1391)

The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
(cherry picked from commit db39bc4)

Co-authored-by: Josh Brobst <jbrobst@proton.me>
@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Jul 5, 2024
@bedevere-app
Copy link

bedevere-app bot commented Jul 5, 2024

GH-121393 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 bug and security fixes label Jul 5, 2024
vstinner pushed a commit that referenced this pull request Jul 5, 2024
…#121393)

gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391)

The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
(cherry picked from commit db39bc4)

Co-authored-by: Josh Brobst <jbrobst@proton.me>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
vstinner pushed a commit that referenced this pull request Jul 21, 2024
…#121392)

gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391)

The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
(cherry picked from commit db39bc4)

Co-authored-by: Josh Brobst <jbrobst@proton.me>
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.

3 participants