bpo-45691: Make array of small ints static to fix use-after-free error. by markshannon · Pull Request #29366 · python/cpython · GitHub
Skip to content

bpo-45691: Make array of small ints static to fix use-after-free error. - #29366

Merged
markshannon merged 2 commits into
python:mainfrom
faster-cpython:make-small-ints-static
Nov 3, 2021
Merged

markshannon merged 2 commits into
python:mainfrom
faster-cpython:make-small-ints-static

Conversation

@markshannon

@markshannon markshannon commented Nov 2, 2021

Copy link
Copy Markdown
Member

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note the small ints have been in PyInterpreterState for a while. We didn't get use-after-free until gh-29274. So perhaps we could just revert that one? The general underlying problem in bpo-45691 is one we'll have to fix regardless, so there's no need to go all the way back to using a static global.

Otherwise this looks fine.

(I'm approving assuming that you'll take my feedback into consideration before merging and discuss if you disagree.)

@markshannon

markshannon commented Nov 2, 2021

Copy link
Copy Markdown
Member Author

@ericsnowcurrently

ericsnowcurrently commented Nov 2, 2021

Copy link
Copy Markdown
Member

@ericsnowcurrently ericsnowcurrently left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm good with this.

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.

4 participants