René's URL Explorer Experiment


Title: Crash Due to Exception in threading._shutdown() · Issue #113148 · python/cpython · GitHub

Open Graph Title: Crash Due to Exception in threading._shutdown() · Issue #113148 · python/cpython

X Title: Crash Due to Exception in threading._shutdown() · Issue #113148 · python/cpython

Description: One of the first thing that happens during interpreter finalization is waiting for all non-daemon threads to finish. This is implemented by calling threading._shutdown(). If an exception is raised there (e.g. in a threading "atexit" func...

Open Graph Description: One of the first thing that happens during interpreter finalization is waiting for all non-daemon threads to finish. This is implemented by calling threading._shutdown(). If an exception is raised ...

X Description: One of the first thing that happens during interpreter finalization is waiting for all non-daemon threads to finish. This is implemented by calling threading._shutdown(). If an exception is raised ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Crash Due to Exception in threading._shutdown()","articleBody":"One of the first thing that happens during interpreter finalization is waiting for all non-daemon threads to finish.  This is implemented by calling `threading._shutdown()`.  If an exception is raised there (e.g. in a `threading` \"atexit\" function), it gets ignored and we end up with non-daemon threads still running.  In subinterpreters that results in a fatal error almost immediately after, since we make sure there's only one thread state left at that point.\r\n\r\n\u003cdetails\u003e\r\n\u003csummary\u003eReproducer:\u003c/summary\u003e\r\n\r\n```\r\n$ cat \u003e /tmp/crash-interp-lingering-thread.py \u003c\u003c EOF\r\nimport threading\r\nfrom test.support import interpreters\r\n\r\ninterp = interpreters.create()\r\ninterp.exec_sync(f\"\"\"if True:\r\n    import threading\r\n    import time\r\n\r\n    done = False\r\n\r\n    def notify_fini():\r\n        global done\r\n        done = True\r\n        raise Exception  # \u003c-------\r\n        t.join()\r\n    threading._register_atexit(notify_fini)\r\n\r\n    def task():\r\n        while not done:\r\n            time.sleep(0.1)\r\n    t = threading.Thread(target=task)\r\n    t.start()\r\n\"\"\")\r\ninterp.close()\r\n\r\n\r\nEOF\r\n$ ./python /tmp/crash-interp-lingering-thread.py\r\nException ignored on threading shutdown:\r\nTraceback (most recent call last):\r\n  File \"./cpython/Lib/threading.py\", line 1623, in _shutdown\r\n    atexit_call()\r\n  File \"\u003cstring\u003e\", line 10, in notify_fini\r\nException:\r\nFatal Python error: Py_EndInterpreter: not the last thread\r\nPython runtime state: initialized\r\n\r\nCurrent thread 0x00007fc8bf76a100 (most recent call first):\r\n  \u003cno Python frame\u003e\r\n\r\nThread 0x00007fc8bd3d5700 (most recent call first):\r\n  File \"\u003cstring\u003e\", line 16 in task\r\n  File \"./cpython/Lib/threading.py\", line 1020 in run\r\n  File \"./cpython/Lib/threading.py\", line 1083 in _bootstrap_inner\r\n  File \"./cpython/Lib/threading.py\", line 1040 in _bootstrap\r\nAborted (core dumped)\r\n```\r\n\r\n\u003c/details\u003e\r\n\r\n----\r\n\r\nThe solution?  Make sure `threading._shutdown()` finishes its fundamental job: stop all non-daemon threads and wait for them to finish.  At the very least, this means ignoring exceptions from functions registered with `threading._register_atexit()`.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-130594\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/ericsnowcurrently","@type":"Person","name":"ericsnowcurrently"},"datePublished":"2023-12-14T21:45:55.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/113148/cpython/issues/113148"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:6fbf45c7-f1a3-3e51-bc8e-7b46799dfdc6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA77E:3499D7:28F21A:37EDF9:6A568CC8
html-safe-noncee4cbc350bbf2f81755fed50d87db995de7d889781c19e0f285e69bfecbaefafc
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNzdFOjM0OTlENzoyOEYyMUE6MzdFREY5OjZBNTY4Q0M4IiwidmlzaXRvcl9pZCI6IjgxMzU2MTQ1MjA4NzYyNDAwNzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac162374fd9809873adf3569af46fbd61e14feacfcaca4a0a72eed55ed7279fc95
hovercard-subject-tagissue:2042554053
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/113148/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2294c7de9ff31618d3c6391f34bc69884c528c9b6b6a38def6a534a1bed316e5/python/cpython/issues/113148
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2294c7de9ff31618d3c6391f34bc69884c528c9b6b6a38def6a534a1bed316e5/python/cpython/issues/113148
og:image:altOne of the first thing that happens during interpreter finalization is waiting for all non-daemon threads to finish. This is implemented by calling threading._shutdown(). If an exception is raised ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameericsnowcurrently
hostnamegithub.com
expected-hostnamegithub.com
None8f21be8503ba8fe6154df415b855c03af52eae3f285bd6ae1fef041dc053da38
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
release78af172a48a2056810bb627ffa684003e4f9a5ca
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/113148#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F113148
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F113148
Sign up https://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/113148
Reloadhttps://github.com/python/cpython/issues/113148
Reloadhttps://github.com/python/cpython/issues/113148
Please reload this pagehttps://github.com/python/cpython/issues/113148
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/113148
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 35k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 73.8k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.3k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality 0 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security and quality https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Crash Due to Exception in threading._shutdown()https://github.com/python/cpython/issues/113148#top
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%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/ericsnowcurrently
ericsnowcurrentlyhttps://github.com/ericsnowcurrently
on Dec 14, 2023https://github.com/python/cpython/issues/113148#issue-2042554053
gh-113148: Handle exceptions from threading.atexit functions #130594https://github.com/python/cpython/pull/130594
3.12only security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.12%22
3.13bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.13%22
3.14bugs and security fixeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%223.14%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-subinterpretershttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-subinterpreters%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
Subinterpretershttps://github.com/orgs/python/projects/3
Threading issues 🧵https://github.com/orgs/python/projects/12
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.