GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||
GeezerVison is showing github.com — GH-118074: Executors in the COLD_EXITS array are not GC'able by gvanrossum · Pull Request #118117 · python/cpython Conversation
|
|
@adoxalim Can you verify that this fix works for you? (Thanks again for the bug report.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| static int | ||
| executor_is_gc(PyObject *o) | ||
| { | ||
| if ((PyObject *)&COLD_EXITS[0] <= o && o < (PyObject *)&COLD_EXITS[UOP_MAX_TRACE_LENGTH]) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
The address sanitizer warning here seems plausibly correct:
array subscript 800 is above array bounds of ‘_PyExecutorObject[200]’ [-Warray-bounds]
COLD_EXITS has a length of UOP_MAX_TRACE_LENGTH/4. If there's some other reason this is correct, maybe add a comment / a way to suppress the warning?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Oh, you're right. That line was written by Copilot and it looked so plausible but was so wrong. :-(
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The emulated Linux (ARM64) test failures are known, caused by the the QEMU emulation. I'm merging now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| static int | ||
| executor_is_gc(PyObject *o) | ||
| { | ||
| if ((PyObject *)&COLD_EXITS[0] <= o && o < (PyObject *)&COLD_EXITS[COLD_EXIT_COUNT]) { |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This is undefined behavior in C. Although it will mostly work in practice.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
So I take it this should work?
| if ((PyObject *)&COLD_EXITS[0] <= o && o < (PyObject *)&COLD_EXITS[COLD_EXIT_COUNT]) { | |
| if (_Py_IsImmortal(o)) { |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Yes
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a similar thing to the top of executor_traverse()? (Although, really, cold exits don't have exits, so their exit_count should always be zero, right? So why bother.
Anyway, see gh-118182 for a fix.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry for not reviewing this earlier. I'd rather not use As a short term fix, we could change |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.