Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.12] gh-128679: Fix tracemalloc.stop() race conditions (#128897)#129022

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

Merged
vstinner merged 1 commit intopython:3.12fromvstinner:tracemalloc_stop12
Jan 19, 2025

Conversation

@vstinner
Copy link
Member

@vstinnervstinner commentedJan 19, 2025
edited by bedevere-appbot
Loading

tracemalloc_alloc(), tracemalloc_realloc(), PyTraceMalloc_Track(), PyTraceMalloc_Untrack() and _PyTraceMalloc_TraceRef() now check tracemalloc_config.tracing after calling TABLES_LOCK().

_PyTraceMalloc_Stop() now protects more code with TABLES_LOCK(), especially setting tracemalloc_config.tracing to 1.

Add a test using PyTraceMalloc_Track() to test tracemalloc.stop() race condition.

Call _PyTraceMalloc_Init() at Python startup.

(cherry picked from commit6b47499)

…n#128897)tracemalloc_alloc(), tracemalloc_realloc(), PyTraceMalloc_Track(),PyTraceMalloc_Untrack() and _PyTraceMalloc_TraceRef() now checktracemalloc_config.tracing after calling TABLES_LOCK()._PyTraceMalloc_Stop() now protects more code with TABLES_LOCK(),especially setting tracemalloc_config.tracing to 1.Add a test using PyTraceMalloc_Track() to test tracemalloc.stop()race condition.Call _PyTraceMalloc_Init() at Python startup.(cherry picked from commit6b47499)
@vstinner
Copy link
MemberAuthor

I tested manually my change on FreeBSD with Python built in release mode. I ran test_tracemalloc_track_race() 1,000x in a loop (using-F option) and it doesn't crash.

@vstinnervstinnerenabled auto-merge (squash)January 19, 2025 13:12
@vstinnervstinner merged commit6df22cb intopython:3.12Jan 19, 2025
30 checks passed
@vstinnervstinner deleted the tracemalloc_stop12 branchJanuary 19, 2025 13:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp