Repository navigation
gh-159864: Fix syslog.openlog() crash with concurrent sys.argv changes - #159884
Conversation
…changes syslog_get_argv() took sys.argv[0] with PyList_GetItem() and increfed it only afterwards, so on the free-threaded build a concurrent replacement of sys.argv[0] could free it in between. Use PyList_GetItemRef() instead. Co-authored-by: Lazizbek Ergashev <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Thanks @espressolee for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15. |
|
Sorry, @espressolee and @ZeroIntensity, I could not cleanly backport this to Please backport manually with cherry_picker, see the devguide for more information. |
|
GH-159952 is a backport of this pull request to the 3.15 branch. |
|
GH-159954 is a backport of this pull request to the 3.14 branch. |
|
Congrats on your first contribution :) |
… changes (GH-159884) (GH-159952) syslog_get_argv() took sys.argv[0] with PyList_GetItem() and increfed it only afterwards, so on the free-threaded build a concurrent replacement of sys.argv[0] could free it in between. Use PyList_GetItemRef() instead. (cherry picked from commit e5e0748) Co-authored-by: Junhyung Lee <[email protected]> Co-authored-by: Lazizbek Ergashev <[email protected]>
syslog_get_argv()tooksys.argv[0]withPyList_GetItem()and only increfed it afterwards, so on the free-threaded build another thread replacingsys.argv[0]could free it in between. UsePyList_GetItemRef()instead.Adds a regression test to
test_free_threading.test_syslogthat racessyslog.openlog()(withoutident) againstsys.argv[0]assignment.Thanks to @lazerg for confirming the crash on
mainand identifying the fix.Fixes#159864.