-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-43693: Turn localspluskinds into an object #26749
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
(But still I get a crash in _freeze_importlib)
@@ -359,6 +359,7 @@ def _write_atomic(path, data, mode=0o666): | |||
# Python 3.11a1 3454 (compute cell offsets relative to locals bpo-43693) | |||
# Python 3.11a1 3455 (add MAKE_CELL bpo-43693) | |||
# Python 3.11a1 3456 (interleave cell args bpo-43693) | |||
# Python 3.11a1 3457 (Change localsplus to a bytes object bpo-43693) |
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.
I wonder if we're not using up too many magic numbers during pre-alpha...
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.
what are our options?
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.
what are our options?
Going back to the first magic number for 3.11a1. Everything is for the same bpo issue it seems.
@ericsnowcurrently I think I have one failing test left, test_ctypes. In particular:
Have you run into this? |
Yeah, you have to update the test to match the new memory size |
🤖 New build scheduled with the buildbot fleet by @gvanrossum for commit b09738c 🤖 If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again. |
I don't see how these changes could make test_ssl fail (only on Mac), and when I run that test myself it passes. I assume it's flakey. |
Happy buildbots, except refleaks on AMD64 Windows8.1 is still churning. |
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.
mostly LGTM
I've left a few comments for some slight adjustments but otherwise everything looks correct. Thanks for taking the time to do this. FWIW, I now see the value of using PyBytesObject
instead of a raw array like I had, so thanks for educating me! 😄
I'm approving the PR now, assuming that you'll make the relevant changes (or ask) before merging.
Python/compile.c
Outdated
static PyObject * | ||
compute_localsplus_info(struct compiler *c, PyObject *names) |
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.
It seems strange to pass one in and return the other. Perhaps create both in this function?
static PyObject * | |
compute_localsplus_info(struct compiler *c, PyObject *names) | |
static int | |
compute_localsplus_info(struct compiler *c, int nlocalsplus, PyObject **pnames, PyObject **pkinds) |
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.
...and something like "init_localsplus_info" is probably a better name with the shift in responsibility for this function.
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.
It seems strange to pass one in and return the other. Perhaps create both in this function?
I find the C idiom for returning multiple values pretty awkward, so I'll just allocate both before passing them into the function.
While all the tests pass here, when I try them at home, I get a crash in test_descr, both on Mac and Windows. I need to understand better what's going on there. Maybe I just need to merge a later version of main. But I'm out of time for now. |
Oh wait, I get the same crash on main. Something's wrong! |
So, using git bisect I've narrowed it down to GH-26595:
I can repro this on my Mac using the following sequence:
The same three tests also cause a crash on Windows, with roughly the same traceback. @markshannon Can you repro this on your Linux machine? |
Repro what? |
I know, but when I try this at home, on both Windows and Mac, I get a crash (details in my previous comment):
I've painstakingly bisected this behavior down to your PR GH-26595. If I back up in git to the PR before that, that command passes. Any commit on master after that PR, it also fails (including HEAD). And this is both on Mac and on Windows, so I can't blame it on environmental issues -- the two environments are just too different. So I beg you to take this serious. I suspect something odd happens in the LOAD_ATTR cache. Could it be that the CI tests set PYTHONHASHSEED to a fixed value that happens to avoid the crash? |
@markshannon
|
There LOAD_ATTR issue is unrelated (discussed offline, we understand it and Mark will fix), so assuming the tests pass after the merge with origin/main I'll land this. |
This makes memory management for code objects cleaner (no more special casing for ownership of the kinds array).
https://bugs.python.org/issue43693