Uh oh!
There was an error while loading. Please reload this page.
gh-119247: Add macros to use PySequence_Fast safely in free-threaded build - #119315
Conversation
colesbury
left a comment
There was a problem hiding this comment.
Thanks @MojoVampire - this looks good. I left some comments below.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
colesbury
commented
May 21, 2024
I've edited the PR title and comment a bit. Feel free to edit them further, if you would like. |
MojoVampire
commented
May 21, 2024
@colesbury: I think I've addressed everything. Thanks for the quick review! |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
4611857 to
87d894dCompare87d894d to
796cfd9Compare… test for regressions
…sts segfault or die with assertion failures >95% of the time without locking macro, pass reliably with locking macro
Use braces to restrict scope of conditional locking Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
… total time to run tests (both tests combine to less than 200 ms in debug build on my laptop)
…section include Python.h which provides listobject.h)
…onize, and perform multiple joins per loop to increase chance of repro without synchronization
796cfd9 to
254a5a5Compare@DinoV & @colesbury: What needs to happen to perform the final merge? I rebased a few minutes ago to be sure it was fully up-to-date with main, not really sure what the next step is now that it's been reviewed. |
colesbury
commented
May 22, 2024
I'll merge it after the CI passes |
Thanks @MojoVampire for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13. |
…eaded build (pythonGH-119315) Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and `Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use them. Also add a regression test that would crash reliably without this patch. (cherry picked from commit baf347d) Co-authored-by: Josh {*()} Rosenberg <26495692+MojoVampire@users.noreply.github.com>
GH-119419 is a backport of this pull request to the 3.13 branch. |
…readed build (GH-119315) (#119419) Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and `Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use them. Also add a regression test that would crash reliably without this patch. (cherry picked from commit baf347d) Co-authored-by: Josh {*()} Rosenberg <26495692+MojoVampire@users.noreply.github.com>
eendebakpt
commented
May 24, 2024
@MojoVampire Thanks for the PR, the I am trying to use it to make |
eendebakpt
commented
May 24, 2024
Found it! Works, but one has to take care of goto statements in the code that can jump beyond the |
…eaded build (python#119315) Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and `Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use them. Also add a regression test that would crash reliably without this patch.
Add
Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FASTandPy_END_CRITICAL_SECTION_SEQUENCE_FASTmacros and updatestr.jointo use them. Also add a regression test that would crash reliably without this patch.