GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-120198: Fix crash when two thread edit __class__ by Fidget-Spinner · Pull Request #120195 · python/cpython

Conversation

@Fidget-Spinner

@Fidget-Spinner Fidget-Spinner commented Jun 7, 2024 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
  • Issue: Read and write of __class__ in two threads causes crash #120198

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Fidget-Spinner added 5 commits June 6, 2024 23:49
@Fidget-Spinner
Make Py_TYPE and Py_SET_TYPE thread safe
df767e5
@Fidget-Spinner
fix Windows
2e9fda6
@Fidget-Spinner
add test
bda9545
@Fidget-Spinner
style nits
b49dc1a
@Fidget-Spinner
remove free-threaded stuff temporarily
54553a9
@bedevere-app bedevere-app Bot added tests Tests in the Lib/test dir awaiting core review labels Jun 7, 2024
@Fidget-Spinner Fidget-Spinner added skip issue skip news labels Jun 7, 2024
@vstinner
vstinner marked this pull request as draft June 7, 2024 07:11
@bedevere-app bedevere-app Bot removed the awaiting core review label Jun 7, 2024
@vstinner

vstinner commented Jun 7, 2024

Copy link
Copy Markdown
Member

[FOR CI, DO NOT MERGE]

I marked your PR as a draft in this case.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner Fidget-Spinner mentioned this pull request Jun 7, 2024
Read and write of __class__ in two threads causes crash #120198
Closed
@Fidget-Spinner
Remove heap type flags
b1dc75b
@Fidget-Spinner Fidget-Spinner changed the title [FOR CI, DO NOT MERGE] gh-120198: Fix crash from concurrent setting of __class__ Jun 7, 2024
@Fidget-Spinner
Revert "Remove heap type flags"
5523a9e
This reverts commit b1dc75b.
@Fidget-Spinner Fidget-Spinner changed the title gh-120198: Fix crash from concurrent setting of __class__ [FOR TESTING ONLY] crasher Jun 7, 2024
@Fidget-Spinner Fidget-Spinner added the DO-NOT-MERGE label Jun 7, 2024
@Fidget-Spinner @Zheaoli
fix bug
02a5587
Co-Authored-By: Nadeshiko Manju <[email protected]>
@Fidget-Spinner Fidget-Spinner changed the title [FOR TESTING ONLY] crasher gh-120198: Fix crash when two thread edit __class__ Jun 10, 2024
@Fidget-Spinner Fidget-Spinner removed skip issue skip news DO-NOT-MERGE labels Jun 10, 2024
@blurb-it
📜🤖 Added by blurb_it.
70523eb
@Fidget-Spinner
Fidget-Spinner requested a review from zooba June 10, 2024 15:07
@Fidget-Spinner
Fidget-Spinner marked this pull request as ready for review June 10, 2024 15:07
@Fidget-Spinner
Fidget-Spinner requested a review from markshannon as a code owner June 10, 2024 15:07
@bedevere-app bedevere-app Bot added the awaiting core review label Jun 10, 2024
zooba
zooba reviewed Jun 10, 2024
View reviewed changes
Comment thread Lib/test/test_free_threading/test_type.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@zooba zooba added the needs backport to 3.12 only security fixes label Jun 10, 2024
@zooba zooba added the needs backport to 3.13 only security fixes label Jun 10, 2024
@Fidget-Spinner @zooba
Move test like Steve suggested
1fc5c01
Co-Authored-By: Steve Dower <[email protected]>
Zheaoli
Zheaoli approved these changes Jun 10, 2024
View reviewed changes

@Zheaoli Zheaoli left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

LGTM

BTW should we backport this to 3.11?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Fidget-Spinner
Merge branch 'hello' of github.com:Fidget-Spinner/cpython into hello
a80f876
@zooba

zooba commented Jun 10, 2024

Copy link
Copy Markdown
Member

If we go to 3.11 then we go to 3.8 (unless the audit event was added later). Technically we should, because crashers are technically eligible for security fix releases, but this one really requires deliberate exploitation and it's very unlikely to be achievable without arbitrary code. And the test is likely to destabilise earlier releases more than the fix is worth.

If someone wants to prepare a PR against 3.11 without the test, we can let the RMs decide.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner
skip test if no threads
b70dc07
@Fidget-Spinner
Fidget-Spinner requested review from serhiy-storchaka and zooba June 11, 2024 09:35
@zooba
zooba merged commit 203565b into python:main Jun 11, 2024
@miss-islington-app

miss-islington-app Bot commented Jun 11, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting core review label Jun 11, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 11, 2024
@Fidget-Spinner @miss-islington
pythongh-120198: Fix race condition when editing __class__ with an au…
2a5692a
…dit hook active (pythonGH-120195)

(cherry picked from commit 203565b)

Co-authored-by: Ken Jin <[email protected]>
@miss-islington-app

miss-islington-app Bot commented Jun 11, 2024

Copy link
Copy Markdown

Sorry, @Fidget-Spinner and @zooba, I could not cleanly backport this to 3.12 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 203565b2f9c74656ba519780049b46d4e5afcba1 3.12
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned zooba Jun 11, 2024
@bedevere-app

bedevere-app Bot commented Jun 11, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 only security fixes label Jun 11, 2024
@zooba zooba assigned Fidget-Spinner and unassigned zooba Jun 11, 2024
@zooba

zooba commented Jun 11, 2024

Copy link
Copy Markdown
Member

@Fidget-Spinner Could you handle the backport, please?

Fidget-Spinner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

zooba pushed a commit that referenced this pull request Jun 11, 2024
@miss-islington @Fidget-Spinner
gh-120198: Fix race condition when editing __class__ with an audit ho…
a6c4080
…ok active (GH-120195)

(cherry picked from commit 203565b)

Co-authored-by: Ken Jin <[email protected]>
@Fidget-Spinner

Fidget-Spinner commented Jun 12, 2024

Copy link
Copy Markdown
Member Author

@zooba sure!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner

Fidget-Spinner commented Jun 12, 2024

Copy link
Copy Markdown
Member Author

@Zheaoli so sorry I had planned to add you as co-author when merging but was asleep when this merged.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner Fidget-Spinner mentioned this pull request Jun 12, 2024
[3.12] gh-120198: Fix race condition when editing __class__ with an audit hook active (GH-120195) #120393
Merged
@bedevere-app

bedevere-app Bot commented Jun 12, 2024

Copy link
Copy Markdown

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

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.12 only security fixes label Jun 12, 2024
@Fidget-Spinner
Fidget-Spinner deleted the hello branch June 12, 2024 11:32
zooba pushed a commit that referenced this pull request Jun 12, 2024
@Fidget-Spinner @Zheaoli
gh-120198: Fix race condition when editing __class__ with an audit ho…
e8a9f0c
…ok active (GH-120195)

Co-authored-by: Nadeshiko Manju <[email protected]>
@Zheaoli

Zheaoli commented Jun 12, 2024

Copy link
Copy Markdown
Contributor

@Fidget-Spinner No problem sir! Thanks very much. I'm so happy to see we solve this issue

Fidget-Spinner reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
@Fidget-Spinner @mrahtz
pythongh-120198: Fix race condition when editing __class__ with an au…
a9a5889
…dit hook active (pythonGH-120195)
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@Fidget-Spinner @estyxx
pythongh-120198: Fix race condition when editing __class__ with an au…
7346d61
…dit hook active (pythonGH-120195)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@markshannon markshannon Awaiting requested review from markshannon markshannon is a code owner
@serhiy-storchaka serhiy-storchaka Awaiting requested review from serhiy-storchaka
@zooba zooba Awaiting requested review from zooba
1 more reviewer
@Zheaoli Zheaoli Zheaoli approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Fidget-Spinner Fidget-Spinner

Labels

tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Fidget-Spinner @vstinner @zooba @Zheaoli
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.