GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-159864: Fix syslog.openlog() crash with concurrent sys.argv changes by espressolee · Pull Request #159884 · python/cpython

Conversation

@espressolee

@espressolee espressolee commented Oct 20, 2026 •
edited by ZeroIntensity
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

syslog_get_argv() took sys.argv[0] with PyList_GetItem() and only increfed it afterwards, so on the free-threaded build another thread replacing sys.argv[0] could free it in between. Use PyList_GetItemRef() instead.

Adds a regression test to test_free_threading.test_syslog that races syslog.openlog() (without ident) against sys.argv[0] assignment.

Thanks to @lazerg for confirming the crash on main and identifying the fix.

Fixes #159864.

  • Issue: Free-threaded: concurrent syslog.openlog() and sys.argv[0] assignment crash the interpreter #159864

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@espressolee @lazerg
pythongh-159864: Fix syslog.openlog() crash with concurrent sys.argv …
38a30c5
…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]>
@python-cla-bot

python-cla-bot Bot commented Oct 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

All commit authors signed the Contributor License Agreement.

CLA signed

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot mentioned this pull request Oct 20, 2026
Free-threaded: concurrent syslog.openlog() and sys.argv[0] assignment crash the interpreter #159864
Closed
@bedevere-app bedevere-app Bot added the awaiting review label Oct 20, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T13:43:10.293424Z 38a30c5 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

aisk
aisk approved these changes Oct 20, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting core review and removed awaiting review labels Oct 20, 2026
@aisk aisk added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Oct 20, 2026
ZeroIntensity
ZeroIntensity approved these changes Oct 20, 2026
View reviewed changes
@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting core review labels Oct 20, 2026
@ZeroIntensity
ZeroIntensity merged commit e5e0748 into python:main Oct 20, 2026
116 of 118 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Oct 20, 2026

Copy link
Copy Markdown

Thanks @espressolee for the PR, and @ZeroIntensity for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14, 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting merge label Oct 20, 2026
@miss-islington-app

miss-islington-app Bot commented Oct 20, 2026

Copy link
Copy Markdown

Sorry, @espressolee and @ZeroIntensity, I could not cleanly backport this to 3.14 due to a conflict.

Please backport manually with cherry_picker, see the devguide for more information.

cherry_picker e5e0748abd27e39655cb8dc313a82cad6563c54f 3.14
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app

bedevere-app Bot commented Oct 20, 2026

Copy link
Copy Markdown

GH-159952 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Oct 20, 2026
@miss-islington-app miss-islington-app Bot assigned ZeroIntensity Oct 20, 2026
@bedevere-app

bedevere-app Bot commented Oct 20, 2026

Copy link
Copy Markdown

GH-159954 is a backport of this pull request to the 3.14 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Oct 20, 2026
@ZeroIntensity

ZeroIntensity commented Oct 20, 2026

Copy link
Copy Markdown
Member

Congrats on your first contribution :)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

ZeroIntensity pushed a commit that referenced this pull request Oct 20, 2026
@miss-islington @espressolee @lazerg
[3.15] gh-159864: Fix syslog.openlog() crash with concurrent sys.argv…
a11aa06
… 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]>
ZeroIntensity added a commit that referenced this pull request Oct 21, 2026
@ZeroIntensity @espressolee @lazerg
[3.14] gh-159864: Fix syslog.openlog() crash with concurrent sys.argv…
ed5bcda
… changes (GH-159884) (GH-159954)

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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@aisk aisk aisk approved these changes
@ZeroIntensity ZeroIntensity ZeroIntensity approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@ZeroIntensity ZeroIntensity

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@espressolee @ZeroIntensity @aisk
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.