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-102509: Start initializing `ob_digit` of `_PyLongValue` by illia-v · Pull Request #102510 · python/cpython Conversation
|
|
@illia-v Can you provide Python code that reproduces the access of the uninitialized value? The theory is that it shouldn't matter that this digit is uninitialized when I'm not convinced that |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think I see. In the case So I think this counts as a false positive, and no fix is necessary. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Pinging @markshannon, who introduced this logic: Mark, I don't see any issue here, and think this should be closed. Agreed? |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
It may still be worth adding a comment in |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
To be clear, if this weren't a hot path then I'd probably add the extra initialization just for peace of mind, but |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This does seem to be a real bug.
Are you sure about this? I expect this code to go when #101291 is implemented, so we might as well fix it for now. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Fairly sure, yes. :-) We either get an uninitialised value (which is fine), or a trap representation (which is not), but trap representations in integers are not a practical problem these days. Here's a good Stack Overflow answer by Eric Postpischil that quotes chapter and verse: https://stackoverflow.com/a/66840190/270986 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
It should be fine - at that point, the uninitialised value is some value of type |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I am not very familiar with this part of CPython source, but comments and code itself mention not only Lines 25 to 34 in 3adb23a
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Yes, but if If this goes in, we should have a comment explaining why the extra initialization is necessary (possibly with a pointer to this PR or the associated issue), and this comment in My preferred solution here would be to go back to a more obviously correct spelling for |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
The performance impact of this change is in the noise. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
We expect the internals of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @illia-v for the PR, and @markshannon for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-107464 is a backport of this pull request to the 3.12 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…honGH-102510) (cherry picked from commit fc130c4) Co-authored-by: Illia Volochii <[email protected]>
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.