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 — [3.9] bpo-46615: Don't crash when set operations mutate the sets (GH-31120) by sweeneyde · Pull Request #31312 · python/cpython

Conversation

@sweeneyde

@sweeneyde sweeneyde commented Feb 13, 2022 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

Ensure strong references are acquired whenever using set_next(). Added randomized test cases for __eq__ methods that sometimes mutate sets when called.

(cherry picked from commit 4a66615)

https://bugs.python.org/issue46615

Sorry, something went wrong.

Uh oh!

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

All reactions
@sweeneyde
bpo-46615: Don't crash when set operations mutate the sets (pythonGH-…
e3ffd17
…31120)

Ensure strong references are acquired whenever using `set_next()`. Added randomized test cases for `__eq__` methods that sometimes mutate sets when called.

(cherry picked from commit 4a66615)
@sweeneyde
sweeneyde requested a review from rhettinger as a code owner February 13, 2022 02:47
@bedevere-bot bedevere-bot added the awaiting core review label Feb 13, 2022
@the-knights-who-say-ni the-knights-who-say-ni added the CLA signed label Feb 13, 2022
@bedevere-bot bedevere-bot mentioned this pull request Feb 13, 2022
bpo-46615: Don't crash when set operations mutate the sets #31120
Merged
@bedevere-bot bedevere-bot added the type-bug An unexpected behavior, bug, or error label Feb 13, 2022
@sweeneyde
sweeneyde requested a review from serhiy-storchaka February 13, 2022 02:47
sweeneyde
sweeneyde commented Feb 13, 2022
View reviewed changes
Comment thread Objects/setobject.c
key = entry->key;
hash = entry->hash;
Py_INCREF(key);
rv = _PyDict_Contains(other, key, hash);

@sweeneyde sweeneyde Feb 13, 2022

Copy link
Copy Markdown
Member Author

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.

Note: cherry-picker only struggled because this is _PyDict_Contains_KnownHash() in main.

Sorry, something went wrong.

Uh oh!

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

All reactions
@serhiy-storchaka
serhiy-storchaka merged commit c31b8a9 into python:3.9 Feb 13, 2022
@bedevere-bot bedevere-bot removed the awaiting core review label Feb 13, 2022
@sweeneyde
sweeneyde deleted the backport-4a66615-3.9 branch February 13, 2022 18:18
@sweeneyde sweeneyde mentioned this pull request May 18, 2022
Use-after-free by mutating set during set operations #90773
Closed
hello-adam pushed a commit to hello-adam/cpython that referenced this pull request Jun 2, 2022
@sweeneyde @hello-adam
bpo-46615: Don't crash when set operations mutate the sets (pythonGH-…
2a484f1
…31120) (pythonGH-31312)

Ensure strong references are acquired whenever using `set_next()`. Added randomized test cases for `__eq__` methods that sometimes mutate sets when called.

(cherry picked from commit 4a66615)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rhettinger rhettinger Awaiting requested review from rhettinger rhettinger is a code owner
@serhiy-storchaka serhiy-storchaka Awaiting requested review from serhiy-storchaka

Uh oh!

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

Assignees

No one assigned

Labels

type-bug An unexpected behavior, bug, or error

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

@sweeneyde @serhiy-storchaka @the-knights-who-say-ni @bedevere-bot
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 01402503 — 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.