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-150505: fix data race in Unpickler_set_memo under free-threading by AhmedMagdy9876 · Pull Request #150550 · python/cpython Conversation
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…ding Unpickler_set_memo modified self->memo and self->memo_size without any critical section, allowing concurrent threads to race on the same Unpickler instance. Wrap the memo population loop and the pointer swap in Py_BEGIN_CRITICAL_SECTION/Py_END_CRITICAL_SECTION to serialize access.
486a6e4 to
61839ca
Compare
|
I really feel getting ignored. Please read the contributions guidelines of our project first. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sharing Pickler or Unpickler instances across threads has no defined semantics. The internal state (memo, stream position, stack) forms a single coherent parse/serialize state that cannot be meaningfully used across threads simultaneously.
There was an error while loading. Please reload this page.
Documentation build overview
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@picnixz apologies, never meant to ignore you, genuinely missed your comments and saw them later:
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@AhmedMagdy9876 I see you reverted a change that I assume fixed the segmentation fault, can I ask you why? The documentation change is looking good, but we probably want to prevent the segfault as well. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
@dpdani thanks for the feedback. The revert was based on the discussion in the linked issue (#150505). @kumaraditya303 questioned whether sharing Unpickler instances across threads should be a supported use case. A critical section fix would prevent the crash but wouldn't validate shared usage. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
@kumaraditya303 correct me if I'm wrong, but I didn't read your comment as implying to keep the segmentation fault? I think it makes sense to keep a stance similar to #133885: use locks to prevent segmentation faults, but still allow undefined output. I don't see why would like something different here. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This PR is stale because it has been open for 90 days with no activity. |
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.
Segfault in_Unpickler_MemoPut (_pickle.c) from Unpickler.memo assignment with free-threading
There was an error while loading. Please reload this page.