bpo-45691: Make array of small ints static to fix use-after-free error.#29366
bpo-45691: Make array of small ints static to fix use-after-free error.#29366markshannon merged 2 commits intopython:mainfrom
Conversation
ericsnowcurrently
left a comment
There was a problem hiding this comment.
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.)
|
As I stated in bpo-45691, we need to make everything static or per-interpreter. Right now that means static. The best way to move towards multiple interpreters is to merge all the static state into a single struct. That way there is only one static value to convert to per-interpreter when we are ready. We can start with the small ints 🙂 |
FYI, that's exactly what |
ericsnowcurrently
left a comment
There was a problem hiding this comment.
I'm good with this.
https://bugs.python.org/issue45691