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-153291: Fix data race in readline.get_completer() and get_pre_input_hook() by harjothkhara · Pull Request #153362 · python/cpython Conversation
Contributor
The fix adds Verified with a free-threaded TSAN build ( Deliberately not included here: I used AI assistance while working on this change; I've reviewed it and can explain it.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
brijkapadia
reviewed
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this test necessary? It didn't fail on main for me.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
|
| @threading_helper.requires_working_threading() | ||
| def test_free_threading_get_completer(self): | ||
| def completer(b): | ||
| b.wait() |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing the barrier as an argument, you can just reference it directly:
| b.wait() | |
| barrier.wait() |
You could then remove the arguments from the args parameter.
Same with the other test.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
I think the tests need to get moved to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…hreading The Argument Clinic getters are exercised there under the TSan CI job (test_free_threading is in TSAN_TESTS; test_readline is not).
|
Moved them to |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
This other test probably also needs to run with TSan: cpython/Lib/test/test_readline.py Lines 449 to 463 in b2d8db1
It might be a good idea to move it in this PR although that's probably better answered by someone else |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Aside from moving the test, this PR LGTM. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Thanks @harjothkhara for the PR, and @nascheme for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
GH-154418 is a backport of this pull request to the 3.15 branch. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
…re_input_hook() (gh-153362) (gh-154418) The setters store these hooks while holding the module critical section (via set_hook's Py_XSETREF), but the getters read and Py_NewRef the same fields without it. Annotate both getters with @critical_section, matching the other readline functions (gh-126895). (cherry picked from commit 90b6a79) Co-authored-by: Harjoth Khara <[email protected]> Co-authored-by: Neil Schemenauer <[email protected]>
|
Thanks @harjothkhara for the PR, and @nascheme for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry, @harjothkhara and @nascheme, I could not cleanly backport this to Please backport manually with cherry_picker, see the devguide for more information. |
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.
There was an error while loading. Please reload this page.