Remove hardcoded offsets for Python 3.14 and 3.15#312
Open
godlygeek wants to merge 1 commit into
Open
Conversation
These offsets are no longer used for anything in the overwhelming majority of cases. The only way that they could be used is if a process running a modern version of Python managed to trash memory in a way that corrupted the `_Py_DebugOffsets` structure in memory. And unfortunately, even in that case, we would go on to behave incorrectly: the Python 3.14 debug offsets were wrong. Since these aren't being used and haven't been being well maintained, and since they're impossible to properly test, and since they're impossible to make work for multiple different interpreter flavors (GIL vs free-threading, JIT vs no-JIT, etc) and they could even change between two patch versions of the interpreter for the same flavor, let's just remove them and turn it into a hard failure if someone manages to trash memory so badly that the `_Py_DebugOffsets` structure can't be used. Signed-off-by: Matt Wozniski <mwozniski@bloomberg.net>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #312 +/- ##
==========================================
- Coverage 79.16% 79.05% -0.11%
==========================================
Files 51 51
Lines 5567 5577 +10
Branches 584 587 +3
==========================================
+ Hits 4407 4409 +2
- Misses 1160 1168 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These offsets are no longer used for anything in the overwhelming majority of cases. The only way that they could be used is if a process running a modern version of Python managed to trash memory in a way that corrupted the
_Py_DebugOffsetsstructure in memory. And unfortunately, even in that case, we would go on to behave incorrectly: the Python 3.14 debug offsets were wrong.Since these aren't being used and haven't been being well maintained, and since they're impossible to properly test, and since they're impossible to make work for multiple different interpreter flavors (GIL vs free-threading, JIT vs no-JIT, etc) and they could even change between two patch versions of the interpreter for the same flavor, let's just remove them and turn it into a hard failure if someone manages to trash memory so badly that the
_Py_DebugOffsetsstructure can't be used.