René's URL Explorer Experiment


Title: Free-threaded: concurrent syslog.openlog() and sys.argv[0] assignment crash the interpreter · Issue #159864 · python/cpython · GitHub

Open Graph Title: Free-threaded: concurrent syslog.openlog() and sys.argv[0] assignment crash the interpreter · Issue #159864 · python/cpython

X Title: Free-threaded: concurrent syslog.openlog() and sys.argv[0] assignment crash the interpreter · Issue #159864 · python/cpython

Description: On the free-threaded build, calling syslog.openlog() (without ident) in several threads while another thread assigns sys.argv[0] crashes the interpreter with SIGSEGV. I ran the script below as a separate process (python3.14t repro.py, 5 ...

Open Graph Description: On the free-threaded build, calling syslog.openlog() (without ident) in several threads while another thread assigns sys.argv[0] crashes the interpreter with SIGSEGV. I ran the script below as a se...

X Description: On the free-threaded build, calling syslog.openlog() (without ident) in several threads while another thread assigns sys.argv[0] crashes the interpreter with SIGSEGV. I ran the script below as a se...

Opengraph URL: https://github.com/python/cpython/issues/159864

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Free-threaded: concurrent syslog.openlog() and sys.argv[0] assignment crash the interpreter","articleBody":"On the free-threaded build, calling `syslog.openlog()` (without `ident`) in several threads while another thread assigns `sys.argv[0]` crashes the interpreter with SIGSEGV.\n\nI ran the script below as a separate process (`python3.14t repro.py`, 5 times, default environment) on macOS 27.0.1 arm64 with the python-build-standalone build `cpython-3.14.6+freethreaded-macos-aarch64-none` installed by uv. Every run was killed by a signal: SIGSEGV in 2 runs and SIGTRAP in 3 (shell exit codes 139 and 133). An earlier driver with the same structure (three `openlog()` threads, one writer, 4 s, `PYTHONMALLOC=debug`) crashed 3.14.0rc1, 3.14.6 and 3.15.0b4 in 5 of 5 runs each; only the last 200 characters of stderr were kept from those runs, so they give no crash-site evidence. I have not tested 3.14.8 or `main`.\n\nReading the source on `main` (4c73f50ca9, lines 109–110), `syslog_get_argv()` in `Modules/syslogmodule.c` takes `sys.argv[0]` with `PyList_GetItem()` (a borrowed reference) and increfs it only afterwards. This suggests a possible borrowed-reference lifetime race with a concurrent replacement of `sys.argv[0]`; I have not established that this race causes the observed SIGSEGV. `PyList_GetItemRef()` may address this particular window; I have not validated a patch.\n\nThe same pattern was listed as item 91 of #157197, which was closed for procedural reasons and whose linked gists are gone; I am not aware of another report specifically tracking it.\n\n\u003cdetails>\u003csummary>Reproducer (run as a separate process; repeat a few times)\u003c/summary>\n\n```python\nimport sys\nimport syslog\nimport threading\nimport time\n\nassert not sys._is_gil_enabled(), \"needs a free-threaded build with the GIL disabled\"\n\nstop = threading.Event()\n\ndef reader():\n    while not stop.is_set():\n        syslog.openlog()\n\ndef writer():\n    i = 0\n    while not stop.is_set():\n        i += 1\n        sys.argv[0] = f\"prog-{i}\" + \"z\" * 24\n\nthreads = [threading.Thread(target=reader) for _ in range(3)]\nthreads.append(threading.Thread(target=writer))\nfor t in threads:\n    t.start()\ntime.sleep(4)\nstop.set()\nfor t in threads:\n    t.join()\nsyslog.closelog()\nprint(\"no crash in 4 s\")\n```\n\n\u003c/details>\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-159884\n* gh-159952\n* gh-159954\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/espressolee","@type":"Person","name":"espressolee"},"datePublished":"2026-10-20T07:00:55Z","url":"https://github.com/python/cpython/issues/159864"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e305124a-f002-9a92-799d-9b85e332fb2e
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE264:336727:BF28EF:F9A47C:6AF8583F
html-safe-nonce2c70799102274eaeca1642752e213fb6359de7170b3bbf5dafbbff5b8dc57e19
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjY0OjMzNjcyNzpCRjI4RUY6RjlBNDdDOjZBRjg1ODNGIiwidmlzaXRvcl9pZCI6IjkyNDE1NzI3NjA0MDIyMjc4MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf3596755f80367b39878b9005ce68d8c71ed66799c2be919899ef42d035c3802
hovercard-subject-tagissue:5937393919
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/159864/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d1fa8eb78492e7550a0e523c1a9fba21d5ab4fc1c0b37e8a3774b3b668b24c58/python/cpython/issues/159864
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d1fa8eb78492e7550a0e523c1a9fba21d5ab4fc1c0b37e8a3774b3b668b24c58/python/cpython/issues/159864
og:image:altOn the free-threaded build, calling syslog.openlog() (without ident) in several threads while another thread assigns sys.argv[0] crashes the interpreter with SIGSEGV. I ran the script below as a se...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameespressolee
hostnamegithub.com
expected-hostnamegithub.com
None5713ecd83001b2f55c3509fb7a292bf7d66d0f167c7ae87a9f7eaec5a52bf8db
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release653be32ff5c755082a4db662491bfbbcfc9112c1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/159864#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F159864
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F159864
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/159864
Reloadhttps://github.com/python/cpython/issues/159864
Reloadhttps://github.com/python/cpython/issues/159864
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/pulse
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/159864
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/159864
Free-threaded: concurrent syslog.openlog() and sys.argv[0] assignment crash the interpreterhttps://github.com/python/cpython/issues/159864#top
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
type-crashA hard crash of the interpreter, possibly with a core dumphttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-crash%22
https://github.com/espressolee
espressoleehttps://github.com/espressolee
on Oct 20, 2026https://github.com/python/cpython/issues/159864#issue-5937393919
4c73f50https://github.com/python/cpython/commit/4c73f50ca9885e5850dae64463e87cf5e80992a1
#157197https://github.com/python/cpython/issues/157197
gh-159864: Fix syslog.openlog() crash with concurrent sys.argv changes #159884https://github.com/python/cpython/pull/159884
[3.15] gh-159864: Fix syslog.openlog() crash with concurrent sys.argv changes (GH-159884) #159952https://github.com/python/cpython/pull/159952
[3.14] gh-159864: Fix syslog.openlog() crash with concurrent sys.argv changes (GH-159884) #159954https://github.com/python/cpython/pull/159954
https://github.com/lazerg
lazerghttps://github.com/lazerg
on Oct 20, 2026https://github.com/python/cpython/issues/159864#issuecomment-6286009795
@espressoleehttps://github.com/espressolee
https://github.com/espressolee
espressoleehttps://github.com/espressolee
on Oct 20, 2026https://github.com/python/cpython/issues/159864#issuecomment-6290503652
aiskhttps://github.com/aisk
type-crashA hard crash of the interpreter, possibly with a core dumphttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-crash%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
on Oct 20, 2026https://github.com/python/cpython/issues/159864#event-33739713973
ZeroIntensityhttps://github.com/ZeroIntensity
on Oct 20, 2026https://github.com/python/cpython/issues/159864#event-33777801311
gh-159864: Fix syslog.openlog() crash with concurrent sys.argv changes (https://github.com/python/cpython/commit/e5e0748abd27e39655cb8dc313a82cad6563c54f
gh-159864https://github.com/python/cpython/issues/159864
e5e0748https://github.com/python/cpython/commit/e5e0748abd27e39655cb8dc313a82cad6563c54f
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Oct 20, 2026https://github.com/python/cpython/issues/159864#issuecomment-6299687471
@espressoleehttps://github.com/espressolee
ZeroIntensityhttps://github.com/ZeroIntensity
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 20, 2026https://github.com/python/cpython/issues/159864#event-33778305934
ZeroIntensityhttps://github.com/ZeroIntensity
on Oct 20, 2026https://github.com/python/cpython/issues/159864#event-33787877667
[3.15] gh-159864: Fix syslog.openlog() crash with concurrent sys.argv…https://github.com/python/cpython/commit/a11aa06485c29196f4e20d17b820fd48a060d6b9
gh-159864https://github.com/python/cpython/issues/159864
a11aa06https://github.com/python/cpython/commit/a11aa06485c29196f4e20d17b820fd48a060d6b9
[3.14] gh-159864: Fix syslog.openlog() crash with concurrent sys.argv…https://github.com/python/cpython/commit/ed5bcda8ded8de36136a61c32eafb0fe51de7cd3
gh-159864https://github.com/python/cpython/issues/159864
ed5bcdahttps://github.com/python/cpython/commit/ed5bcda8ded8de36136a61c32eafb0fe51de7cd3
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/159864
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/159864
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
type-crashA hard crash of the interpreter, possibly with a core dumphttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-crash%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.