gh-149816: Fix a race condition in _PyBytes_FromList with free-threading#149909
Conversation
|
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
Sorry, @sobolevn, I could not cleanly backport this to |
|
GH-149911 is a backport of this pull request to the 3.15 branch. |
|
GH-149912 is a backport of this pull request to the 3.14 branch. |
|
@sobolevn @kumaraditya303 The same issue was addressed in #132590, which takes a different approach. Using |
_PyBytes_FromListis called fromPyBytes_FromObjectwhich does not own the passed object, so it is a borrowed reference.Using
_PyList_GetItemRefseems like the correct solution here.However, I was not successful in actually triggering the failure without C-API direct usage.