bpo-1635741 - try to port pickle to multi-stage init#21319
Closed
koubaa wants to merge 1 commit intopython:masterfrom
Closed
bpo-1635741 - try to port pickle to multi-stage init#21319koubaa wants to merge 1 commit intopython:masterfrom
koubaa wants to merge 1 commit intopython:masterfrom
Conversation
Contributor
Author
|
Found the problem. PyState_FindModule is used heavily (via _Pickle_GetGlobalState) and this is only supported for single phase init. I could replace some of those with PyType_GetModuleState but some types use Py_TPFLAGS_BASETYPE which means it may not be corrent in one for subclasses. @vstinner Does PEP 573 (or a subsequent PEP) offer any alternative to that? |
Member
Not yet. Until PEP 573 is completed, I suggest to leave extensions which require this feature unmodified. So I suggest to close this PR for now, for example. |
Member
|
ps: you can attention petr's thread if you have free time: https://mail.python.org/archives/list/[email protected]/thread/T3P2QNLNLBRFHWSKYSTPMVEIL2EEKFJU/ |
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.
Right now this patch causes a segfault:
test_unpickle_module_race (test.test_pickle.PyUnpicklerTests) ... Segmentation fault
It's really a clever test. Anyways hopefully the cause is apparent to reviewers. Otherwise I can try to debug it on my own some more
https://bugs.python.org/issue1635741