René's URL Explorer Experiment


Title: test_threading.test_recursion_limit() does crash (segfault) on Alpine Linux (musl) · Issue #148260 · python/cpython · GitHub

Open Graph Title: test_threading.test_recursion_limit() does crash (segfault) on Alpine Linux (musl) · Issue #148260 · python/cpython

X Title: test_threading.test_recursion_limit() does crash (segfault) on Alpine Linux (musl) · Issue #148260 · python/cpython

Description: Python built with ./configure --with-pydebug --disable-gil and gcc -Og on Alpine Linux (Python built with musl C library). Example of crash on "AMD64 Alpine Linux NoGIL 3.x" buildbot: https://buildbot.python.org/#/builders/1819/builds/16...

Open Graph Description: Python built with ./configure --with-pydebug --disable-gil and gcc -Og on Alpine Linux (Python built with musl C library). Example of crash on "AMD64 Alpine Linux NoGIL 3.x" buildbot: https://build...

X Description: Python built with ./configure --with-pydebug --disable-gil and gcc -Og on Alpine Linux (Python built with musl C library). Example of crash on "AMD64 Alpine Linux NoGIL 3.x" buildbot: htt...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_threading.test_recursion_limit() does crash (segfault) on Alpine Linux (musl)","articleBody":"Python built with `./configure --with-pydebug --disable-gil` and `gcc -Og` on Alpine Linux (Python built with `musl` C library).\n\nExample of crash on \"AMD64 Alpine Linux NoGIL 3.x\" buildbot: https://buildbot.python.org/#/builders/1819/builds/1699\n\nScript:\n\n```py\nimport threading\n\ndef recurse():\n    return recurse()\n\ndef outer():\n    try:\n        recurse()\n    except RecursionError:\n        pass\n\nw = threading.Thread(target=outer)\nw.start()\nw.join()\nprint('end of main thread')\n```\n\ngdb traceback:\n\n```\n(gdb) where\n#0  0x0000560e9bedb871 in _Py_Dealloc (op=0x20004156010) at Objects/object.c:3277\n#1  0x0000560e9bedb9ef in _Py_MergeZeroLocalRefcount (op=op@entry=0x20004156010) at Objects/object.c:444\n#2  0x0000560e9c088aaf in Py_DECREF (filename=filename@entry=0x560e9c12425b \"./Include/refcount.h\", \n    lineno=lineno@entry=520, op=0x20004156010) at ./Include/refcount.h:359\n#3  0x0000560e9c088af7 in Py_XDECREF (op=\u003coptimized out>) at ./Include/refcount.h:520\n#4  0x0000560e9c088e30 in tb_dealloc (op=0x20004156070) at Python/traceback.c:245\n#5  0x0000560e9bedb8e0 in _Py_Dealloc (op=0x20004156070) at Objects/object.c:3300\n#6  0x0000560e9bedb9ef in _Py_MergeZeroLocalRefcount (op=op@entry=0x20004156070) at Objects/object.c:444\n#7  0x0000560e9c088aaf in Py_DECREF (filename=filename@entry=0x560e9c12425b \"./Include/refcount.h\", \n    lineno=lineno@entry=520, op=0x20004156070) at ./Include/refcount.h:359\n#8  0x0000560e9c088af7 in Py_XDECREF (op=\u003coptimized out>) at ./Include/refcount.h:520\n#9  0x0000560e9c088e30 in tb_dealloc (op=0x200041560d0) at Python/traceback.c:245\n#10 0x0000560e9bedb8e0 in _Py_Dealloc (op=0x200041560d0) at Objects/object.c:3300\n#11 0x0000560e9bedb9ef in _Py_MergeZeroLocalRefcount (op=op@entry=0x200041560d0) at Objects/object.c:444\n#12 0x0000560e9c088aaf in Py_DECREF (filename=filename@entry=0x560e9c12425b \"./Include/refcount.h\", \n    lineno=lineno@entry=520, op=0x200041560d0) at ./Include/refcount.h:359\n#13 0x0000560e9c088af7 in Py_XDECREF (op=\u003coptimized out>) at ./Include/refcount.h:520\n#14 0x0000560e9c088e30 in tb_dealloc (op=0x20004156130) at Python/traceback.c:245\n#15 0x0000560e9bedb8e0 in _Py_Dealloc (op=0x20004156130) at Objects/object.c:3300\n#16 0x0000560e9bedb9ef in _Py_MergeZeroLocalRefcount (op=op@entry=0x20004156130) at Objects/object.c:444\n#17 0x0000560e9c088aaf in Py_DECREF (filename=filename@entry=0x560e9c12425b \"./Include/refcount.h\", \n    lineno=lineno@entry=520, op=0x20004156130) at ./Include/refcount.h:359\n#18 0x0000560e9c088af7 in Py_XDECREF (op=\u003coptimized out>) at ./Include/refcount.h:520\n#19 0x0000560e9c088e30 in tb_dealloc (op=0x20004156190) at Python/traceback.c:245\n#20 0x0000560e9bedb8e0 in _Py_Dealloc (op=0x20004156190) at Objects/object.c:3300\n#21 0x0000560e9bedb9ef in _Py_MergeZeroLocalRefcount (op=op@entry=0x20004156190) at Objects/object.c:444\n#22 0x0000560e9c088aaf in Py_DECREF (filename=filename@entry=0x560e9c12425b \"./Include/refcount.h\", \n    lineno=lineno@entry=520, op=0x20004156190) at ./Include/refcount.h:359\n#23 0x0000560e9c088af7 in Py_XDECREF (op=\u003coptimized out>) at ./Include/refcount.h:520\n#24 0x0000560e9c088e30 in tb_dealloc (op=0x200041561f0) at Python/traceback.c:245\n#25 0x0000560e9bedb8e0 in _Py_Dealloc (op=0x200041561f0) at Objects/object.c:3300\n#26 0x0000560e9bedb9ef in _Py_MergeZeroLocalRefcount (op=op@entry=0x200041561f0) at Objects/object.c:444\n#27 0x0000560e9c088aaf in Py_DECREF (filename=filename@entry=0x560e9c12425b \"./Include/refcount.h\", \n    lineno=lineno@entry=520, op=0x200041561f0) at ./Include/refcount.h:359\n#28 0x0000560e9c088af7 in Py_XDECREF (op=\u003coptimized out>) at ./Include/refcount.h:520\n#29 0x0000560e9c088e30 in tb_dealloc (op=0x20004156250) at Python/traceback.c:245\n#30 0x0000560e9bedb8e0 in _Py_Dealloc (op=0x20004156250) at Objects/object.c:3300\n#31 0x0000560e9bedb9ef in _Py_MergeZeroLocalRefcount (op=op@entry=0x20004156250) at Objects/object.c:444\n#32 0x0000560e9c088aaf in Py_DECREF (filename=filename@entry=0x560e9c12425b \"./Include/refcount.h\", \n(...)\n#3751 0x0000560e9be774fb in PyObject_Call (callable=\u003coptimized out>, args=\u003coptimized out>, kwargs=\u003coptimized out>)\n    at Objects/call.c:373\n#3752 0x0000560e9c10f6ef in thread_run (boot_raw=boot_raw@entry=0x20000030920) at ./Modules/_threadmodule.c:388\n#3753 0x0000560e9c0874c0 in pythread_wrapper (arg=\u003coptimized out>) at Python/thread_pthread.h:234\n#3754 0x00007f484b327573 in start (p=\u003coptimized out>) at src/thread/pthread_create.c:207\n#3755 0x00007f484b328ec1 in __clone () at src/thread/x86_64/clone.s:22\nBacktrace stopped: frame did not save the PC\n\n(gdb) info threads\n  Id   Target Id                  Frame \n  1    LWP 9804 \"python\"          __cp_end () at src/thread/x86_64/syscall_cp.s:29\n* 2    LWP 9807 \"Thread-1 (outer\" 0x0000560e9bedb871 in _Py_Dealloc (op=0x20004156010) at Objects/object.c:3277\n```\n\n`_Py_Dealloc()` has the `Trashcan` mechanism which is supposed to avoid long chain of `_Py_Dealloc()` calls to reduce the stack memory consumption. But it seems like it doesn't work on Alpine Linux (Python built with `musl` C library).\n\ngdb variables in the `_Py_Dealloc()` frame:\n\n```\n(gdb) p type->tp_name\n$6 = 0x555ba66f5c7f \"traceback\"\n\n(gdb) p gc_flag\n$7 = 16384\n```\n\nIn the parent `_Py_Dealloc()` frame:\n\n```\n(gdb) p type->tp_name\n$9 = 0x555ba66f5c7f \"traceback\"\n(gdb) p gc_flag\n$10 = \u003coptimized out>\n(gdb) p margin\n$11 = 115\n```\n\nIn the first `_Py_Dealloc()` frame (outer):\n\n```\n(gdb) p margin\n$12 = 119\n(gdb) p type->tp_name\n$13 = 0x555ba66e9dcd \"RecursionError\"\n(gdb) p gc_flag\n$14 = \u003coptimized out>\n(gdb) p type->tp_flags & (1UL \u003c\u003c 14)  # gc_flag\n$15 = 16384\n```\n\nOn a regular build (without Free Threading), the script works as expected, it displays:\n\n```\nend of main thread\n```\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-149993\n* gh-150150\n* gh-151586\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/vstinner","@type":"Person","name":"vstinner"},"datePublished":"2026-04-08T16:52:03Z","url":"https://github.com/python/cpython/issues/148260"}

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:5d8fe9c3-d0d4-a4f2-a15f-5fa4f9a34539
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD01A:1F44B8:21ED8D:2F7D4E:6AECB631
html-safe-nonce85bb79e5e2de812904459c5b7c5e6112fe2ff43045ac9e3be81292731b3639d2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDFBOjFGNDRCODoyMUVEOEQ6MkY3RDRFOjZBRUNCNjMxIiwidmlzaXRvcl9pZCI6IjUyOTM5NTM5NjYxNzE1MzQ4OTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacd976acaa7527fcd8563bc0128a3841df8afc6c210d37c7085a98a757cd22d5bf
hovercard-subject-tagissue:4226169440
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/148260/issue_layout
twitter:imagehttps://opengraph.githubassets.com/110716c26e48ffd6e0f136936ccd91043267da84aaf28a05ce5e9317a6df2e8d/python/cpython/issues/148260
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/110716c26e48ffd6e0f136936ccd91043267da84aaf28a05ce5e9317a6df2e8d/python/cpython/issues/148260
og:image:altPython built with ./configure --with-pydebug --disable-gil and gcc -Og on Alpine Linux (Python built with musl C library). Example of crash on "AMD64 Alpine Linux NoGIL 3.x" buildbot: https://build...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevstinner
hostnamegithub.com
expected-hostnamegithub.com
None95ae5445dec4cded2bc4f9d97ede92b9116c0bf381a08a5c844b60b5bddcbc97
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
releasedb4ef601a7f034ae2a68e17d6eeaeb7ee9470192
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/148260#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F148260
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%2F148260
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/148260
Reloadhttps://github.com/python/cpython/issues/148260
Reloadhttps://github.com/python/cpython/issues/148260
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.3k (2.3k)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/148260
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/148260
test_threading.test_recursion_limit() does crash (segfault) on Alpine Linux (musl)https://github.com/python/cpython/issues/148260#top
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Apr 8, 2026https://github.com/python/cpython/issues/148260#issue-4226169440
https://buildbot.python.org/#/builders/1819/builds/1699https://buildbot.python.org/#/builders/1819/builds/1699
gh-148260: Use at least 1 MiB stack size on musl #149993https://github.com/python/cpython/pull/149993
[3.15] gh-148260: Use at least 1 MiB stack size on musl (GH-149993) #150150https://github.com/python/cpython/pull/150150
[3.14] gh-148260: Use at least 1 MiB stack size on musl (GH-149993) #151586https://github.com/python/cpython/pull/151586
vstinnerhttps://github.com/vstinner
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%22
on Apr 8, 2026https://github.com/python/cpython/issues/148260#event-24303983284
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Apr 8, 2026https://github.com/python/cpython/issues/148260#issuecomment-4209613387
vstinnerhttps://github.com/vstinner
on Apr 8, 2026https://github.com/python/cpython/issues/148260#event-24311766674
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Apr 8, 2026https://github.com/python/cpython/issues/148260#issuecomment-4210189927
https://wiki.musl-libc.org/functional-differences-from-glibc.htmlhttps://wiki.musl-libc.org/functional-differences-from-glibc.html
1e9b8f2https://github.com/python/cpython/commit/1e9b8f2f8512ca4ede6ca24113a70e13c9a7cf6b
gh-134336https://github.com/python/cpython/pull/134336
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Apr 8, 2026https://github.com/python/cpython/issues/148260#issuecomment-4210224709
#143730 (comment)https://github.com/python/cpython/pull/143730#issuecomment-4210222563
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on May 7, 2026https://github.com/python/cpython/issues/148260#issuecomment-4396582690
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on May 18, 2026https://github.com/python/cpython/issues/148260#issuecomment-4478518580
gh-149993https://github.com/python/cpython/pull/149993
vstinnerhttps://github.com/vstinner
on May 20, 2026https://github.com/python/cpython/issues/148260#event-25754074134
gh-148260: Use at least 1 MiB stack size on musl (#149993)https://github.com/python/cpython/commit/df6c157e51430e8e7458012417c534ad8c33119f
gh-148260https://github.com/python/cpython/issues/148260
#149993https://github.com/python/cpython/pull/149993
df6c157https://github.com/python/cpython/commit/df6c157e51430e8e7458012417c534ad8c33119f
vstinnerhttps://github.com/vstinner
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 20, 2026https://github.com/python/cpython/issues/148260#event-25754193026
vstinnerhttps://github.com/vstinner
on May 20, 2026https://github.com/python/cpython/issues/148260#event-25755165981
[3.15] gh-148260: Use at least 1 MiB stack size on musl (GH-149993) (#…https://github.com/python/cpython/commit/c555e260615d8d820f6a98e60a1d0ad0a1f13141
gh-148260https://github.com/python/cpython/issues/148260
GH-149993https://github.com/python/cpython/pull/149993
#…https://github.com/python/cpython/pull/150150
c555e26https://github.com/python/cpython/commit/c555e260615d8d820f6a98e60a1d0ad0a1f13141
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on May 20, 2026https://github.com/python/cpython/issues/148260#issuecomment-4498157409
vstinnerhttps://github.com/vstinner
on Jun 17, 2026https://github.com/python/cpython/issues/148260#event-26851564065
[3.14] gh-148260: Use at least 1 MiB stack size on musl (GH-149993) (#…https://github.com/python/cpython/commit/551667248da43b1d3548c3fb3964fdf508ea6a3e
gh-148260https://github.com/python/cpython/issues/148260
GH-149993https://github.com/python/cpython/pull/149993
#…https://github.com/python/cpython/pull/151586
5516672https://github.com/python/cpython/commit/551667248da43b1d3548c3fb3964fdf508ea6a3e
nvuillamhttps://github.com/nvuillam
on Aug 22, 2026https://github.com/python/cpython/issues/148260#event-29856711821
Fix random Segmentation fault crashes on Alpine images (#8733) (#8779)https://github.com/oxsecurity/megalinter/commit/403219a038c39fa2a9b1b1401326ee369543d71b
#8733https://github.com/oxsecurity/megalinter/issues/8733
#8779https://github.com/oxsecurity/megalinter/pull/8779
403219ahttps://github.com/oxsecurity/megalinter/commit/403219a038c39fa2a9b1b1401326ee369543d71b
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/148260
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/148260
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
testsTests in the Lib/test dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22tests%22
topic-free-threadinghttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-free-threading%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.