| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
I'll ping Mark when he's back. IIUC, LOAD_METHOD_CLASS doesn't need to check cls.__dict__ at all. A single cls.tp_version_tag check is sufficient. So we can save on dict calculation and a branch. |
Sorry, something went wrong.
|
🤖 New build scheduled with the buildbot fleet by @Fidget-Spinner for commit af0dd27 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
Sorry, something went wrong.
|
@erlend-aasland the more I look at this the more iffy my code feels. I'm trying to think if this could cause any segfaults. E.g. it accesses a non-type object at offsetoff(PyTypeObject, tp_version_tag, but the object size is smaller than that location, and it just crashes. I will try to produce some code to test my theory. Previously the dict check also served as an object identity check since dk_version is unique. With that, accessing tp_version_tag is always safe. This is guaranteed to always work though if all objects are bigger than offsetoff(PyTypeObject, tp_version_tag). I dont know if thats the case though. Do you remember? |
Sorry, something went wrong.
I do not, and unfortunately I do not have any time to investigate now :( |
Sorry, something went wrong.
|
Thanks for the review Erlend, ultimately I decided to roll back the changes and make the checks stricter. My tests indicate we lost 0.1% of specialization hits, but the added safety is worth it. I can't prove that accessing tp_version_tag will never segfault in all cases. |
Sorry, something went wrong.
There was a problem hiding this comment.
It looks like we missed a check that the operand of LOAD_METHOD_CLASS is actually a class.
Sorry, something went wrong.
|
Looks good, thanks. |
Sorry, something went wrong.
|
FWIW, I can't repro the windows build errors locally. It seems to be affecting every PR right now. |
Sorry, something went wrong.
|
Thanks Mark and Erlend for the reviews! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue45107