René's URL Explorer Experiment


Title: Assertion failure on interrupt when catching exception group · Issue #102056 · python/cpython · GitHub

Open Graph Title: Assertion failure on interrupt when catching exception group · Issue #102056 · python/cpython

X Title: Assertion failure on interrupt when catching exception group · Issue #102056 · python/cpython

Description: This (maybe too made-up and detached from reality) repro causes assertion failure when executed on current main (32df540). On 3.11 it warns about "lost sys.stderr" and terminates. import time import threading import _thread def f(): try:...

Open Graph Description: This (maybe too made-up and detached from reality) repro causes assertion failure when executed on current main (32df540). On 3.11 it warns about "lost sys.stderr" and terminates. import time impor...

X Description: This (maybe too made-up and detached from reality) repro causes assertion failure when executed on current main (32df540). On 3.11 it warns about "lost sys.stderr" and terminates. import ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Assertion failure on interrupt when catching exception group","articleBody":"This (maybe too made-up and detached from reality) repro causes assertion failure when executed on current main (32df540635cacce1053ee0ef98ee23f3f6a43c02).\r\nOn 3.11 it warns about \"lost sys.stderr\" and terminates.\r\n\r\n```python3\r\nimport time\r\nimport threading\r\nimport _thread\r\n\r\ndef f():\r\n    try:\r\n        f()\r\n    except RecursionError:\r\n        f()\r\n\r\ndef g():\r\n    try:\r\n        raise ValueError()\r\n    except* ValueError:\r\n        f()\r\n\r\ndef h():\r\n    time.sleep(1)\r\n    _thread.interrupt_main()\r\n\r\nt = threading.Thread(target=h)\r\nt.start()\r\ng()\r\nt.join()\r\n```\r\n\r\nOutput:\r\n```\r\npython: Objects/typeobject.c:4183: _PyType_Lookup: Assertion `!PyErr_Occurred()' failed.\r\nAborted (core dumped)\r\n```\r\n\r\nStack trace:\r\n```c++\r\n#0  0x00007ffff7d3f34c in __pthread_kill_implementation () from /usr/lib/libc.so.6\r\n#1  0x00007ffff7cf24b8 in raise () from /usr/lib/libc.so.6\r\n#2  0x00007ffff7cdc534 in abort () from /usr/lib/libc.so.6\r\n#3  0x00007ffff7cdc45c in __assert_fail_base.cold () from /usr/lib/libc.so.6\r\n#4  0x00007ffff7ceb116 in __assert_fail () from /usr/lib/libc.so.6\r\n#5  0x000055555574ecd9 in _PyType_Lookup (type=type@entry=0x555555be5430, name=name@entry=0x555555bb7c10 \u003c_PyRuntime+334480\u003e)\r\n    at Objects/typeobject.c:4183\r\n#6  0x00005555557319e3 in _PyObject_GenericGetAttrWithDict (obj=0x7ffff77a7c90, name=0x555555bb7c10 \u003c_PyRuntime+334480\u003e, dict=dict@entry=0x0, \r\n    suppress=suppress@entry=1) at Objects/object.c:1266\r\n#7  0x0000555555731d8d in _PyObject_LookupAttr (v=0x7ffff77a7c90, name=\u003coptimized out\u003e, result=result@entry=0x7ffffff40780) at Objects/object.c:933\r\n#8  0x000055555582764c in print_exception_file_and_line (ctx=ctx@entry=0x7fffffffe270, value_p=value_p@entry=0x7ffffff40808)\r\n    at Python/pythonrun.c:941\r\n#9  0x0000555555827ed2 in print_exception (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff77a7c90) at Python/pythonrun.c:1209\r\n#10 0x0000555555827fcc in print_exception_group (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff77a7c90) at Python/pythonrun.c:1377\r\n#11 0x0000555555828418 in print_exception_recursive (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff77a7c90) at Python/pythonrun.c:1491\r\n#12 0x0000555555828491 in print_chained (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff77a7c90, \r\n    message=message@entry=0x55555594b200 \u003ccontext_message\u003e \"During handling of the above exception, another exception occurred:\\n\", \r\n    tag=tag@entry=0x5555558deda0 \"context\") at Python/pythonrun.c:1254\r\n#13 0x000055555582868e in print_exception_cause_and_context (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff780e900)\r\n    at Python/pythonrun.c:1344\r\n#14 0x00005555558283d3 in print_exception_recursive (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff780e900) at Python/pythonrun.c:1482\r\n#15 0x0000555555828491 in print_chained (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff780e900, \r\n    message=message@entry=0x55555594b200 \u003ccontext_message\u003e \"During handling of the above exception, another exception occurred:\\n\", \r\n    tag=tag@entry=0x5555558deda0 \"context\") at Python/pythonrun.c:1254\r\n\r\n...\r\n\r\n#16186 0x000055555582868e in print_exception_cause_and_context (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0ec0)\r\n    at Python/pythonrun.c:1344\r\n#16187 0x00005555558283d3 in print_exception_recursive (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0ec0) at Python/pythonrun.c:1482\r\n#16188 0x0000555555828491 in print_chained (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0ec0,\r\n    message=message@entry=0x55555594b200 \u003ccontext_message\u003e \"During handling of the above exception, another exception occurred:\\n\",\r\n    tag=tag@entry=0x5555558deda0 \"context\") at Python/pythonrun.c:1254\r\n#16189 0x000055555582868e in print_exception_cause_and_context (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0f30)\r\n    at Python/pythonrun.c:1344\r\n#16190 0x00005555558283d3 in print_exception_recursive (ctx=ctx@entry=0x7fffffffe270, value=value@entry=0x7ffff6be0f30) at Python/pythonrun.c:1482\r\n#16191 0x0000555555828969 in _PyErr_Display (file=file@entry=0x7ffff79ba7b0, exception=exception@entry=0x555555a75160 \u003c_PyExc_KeyboardInterrupt\u003e,\r\n    value=value@entry=0x7ffff6be0f30, tb=tb@entry=0x7ffff6c22ad0) at Python/pythonrun.c:1530\r\n#16192 0x0000555555828ad3 in PyErr_Display (exception=0x555555a75160 \u003c_PyExc_KeyboardInterrupt\u003e, value=0x7ffff6be0f30, tb=0x7ffff6c22ad0)\r\n    at Python/pythonrun.c:1562\r\n#16193 0x0000555555835660 in sys_excepthook_impl (module=module@entry=0x7ffff7947f50, exctype=\u003coptimized out\u003e, value=\u003coptimized out\u003e,\r\n    traceback=\u003coptimized out\u003e) at ./Python/sysmodule.c:748\r\n#16194 0x00005555558356c6 in sys_excepthook (module=0x7ffff7947f50, args=args@entry=0x7fffffffe3f0, nargs=nargs@entry=3)\r\n    at ./Python/clinic/sysmodule.c.h:102\r\n#16195 0x000055555572c28c in cfunction_vectorcall_FASTCALL (func=0x7ffff7948470, args=0x7fffffffe3f0, nargsf=\u003coptimized out\u003e, kwnames=\u003coptimized out\u003e)\r\n    at Objects/methodobject.c:422\r\n#16196 0x00005555556e1aa0 in _PyObject_VectorcallTstate (tstate=0x555555bd8808 \u003c_PyRuntime+468616\u003e, callable=callable@entry=0x7ffff7948470,\r\n    args=0x7fffffffe3f0, args@entry=0x7fffffffe360, nargsf=nargsf@entry=3, kwnames=kwnames@entry=0x0) at ./Include/internal/pycore_call.h:92\r\n#16197 0x00005555556e1b90 in _PyObject_FastCallTstate (nargs=3, args=0x7fffffffe360, func=0x7ffff7948470, tstate=\u003coptimized out\u003e)\r\n    at ./Include/internal/pycore_call.h:116\r\n#16198 _PyObject_FastCall (func=func@entry=0x7ffff7948470, args=args@entry=0x7fffffffe3f0, nargs=nargs@entry=3) at Objects/call.c:310\r\n#16199 0x0000555555828c2b in _PyErr_PrintEx (tstate=0x555555bd8808 \u003c_PyRuntime+468616\u003e, set_sys_last_vars=set_sys_last_vars@entry=1)\r\n    at Python/pythonrun.c:813\r\n#16200 0x0000555555828eb1 in PyErr_PrintEx (set_sys_last_vars=set_sys_last_vars@entry=1) at Python/pythonrun.c:861\r\n#16201 0x0000555555828ec1 in PyErr_Print () at Python/pythonrun.c:867\r\n#16202 0x00005555558293ab in _PyRun_SimpleFileObject (fp=fp@entry=0x555555bdb530, filename=filename@entry=0x7ffff77adbc0, closeit=closeit@entry=1,\r\n    flags=flags@entry=0x7fffffffe508) at Python/pythonrun.c:439\r\n#16203 0x000055555582951d in _PyRun_AnyFileObject (fp=fp@entry=0x555555bdb530, filename=filename@entry=0x7ffff77adbc0, closeit=closeit@entry=1,\r\n    flags=flags@entry=0x7fffffffe508) at Python/pythonrun.c:78\r\n#16204 0x00005555558487a5 in pymain_run_file_obj (program_name=program_name@entry=0x7ffff77c7370, filename=filename@entry=0x7ffff77adbc0,\r\n    skip_source_first_line=0) at Modules/main.c:360\r\n#16205 0x00005555558488cd in pymain_run_file (config=config@entry=0x555555bbd3c0 \u003c_PyRuntime+356928\u003e) at Modules/main.c:379\r\n#16206 0x0000555555849063 in pymain_run_python (exitcode=exitcode@entry=0x7fffffffe684) at Modules/main.c:610\r\n#16207 0x000055555584930f in Py_RunMain () at Modules/main.c:689\r\n#16208 0x0000555555849386 in pymain_main (args=args@entry=0x7fffffffe6e0) at Modules/main.c:719\r\n#16209 0x000055555584944c in Py_BytesMain (argc=\u003coptimized out\u003e, argv=\u003coptimized out\u003e) at Modules/main.c:743\r\n#16210 0x0000555555651772 in main (argc=\u003coptimized out\u003e, argv=\u003coptimized out\u003e) at ./Programs/python.c:15\r\n```\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-102078\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/chgnrdv","@type":"Person","name":"chgnrdv"},"datePublished":"2023-02-19T20:43:04.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/102056/cpython/issues/102056"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5d4dfb0d-77cc-8808-11e6-39efbbbd2437
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA9A6:3AB2A7:5F1934:7C4ABF:696B4665
html-safe-nonce0dc20abc946a6de10ec8e3d2b04fef3ab5b49cca5a52de59b6583220c1e2da92
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBOUE2OjNBQjJBNzo1RjE5MzQ6N0M0QUJGOjY5NkI0NjY1IiwidmlzaXRvcl9pZCI6IjY5ODYyNjU2NzMxMzAwMDIwMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac7c5d2afe2ec5e890d13c9a08136a877d14bd5cb1619ad1d22fdc0fc9b3cd4764
hovercard-subject-tagissue:1590847283
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/102056/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7312242fa886e23abb4c96f1132496fc9695deefa5546036754b9505d31eaf12/python/cpython/issues/102056
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7312242fa886e23abb4c96f1132496fc9695deefa5546036754b9505d31eaf12/python/cpython/issues/102056
og:image:altThis (maybe too made-up and detached from reality) repro causes assertion failure when executed on current main (32df540). On 3.11 it warns about "lost sys.stderr" and terminates. import time impor...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamechgnrdv
hostnamegithub.com
expected-hostnamegithub.com
None5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d
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
release82560a55c6b2054555076f46e683151ee28a19bc
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/issues/102056#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F102056
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
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
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
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/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%2F102056
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/102056
Reloadhttps://github.com/python/cpython/issues/102056
Reloadhttps://github.com/python/cpython/issues/102056
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/issues/102056
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k 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.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/issues/102056
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 https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/102056
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/102056
#102078https://github.com/python/cpython/pull/102078
Assertion failure on interrupt when catching exception grouphttps://github.com/python/cpython/issues/102056#top
#102078https://github.com/python/cpython/pull/102078
https://github.com/iritkatriel
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%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/chgnrdv
https://github.com/chgnrdv
chgnrdvhttps://github.com/chgnrdv
on Feb 19, 2023https://github.com/python/cpython/issues/102056#issue-1590847283
32df540https://github.com/python/cpython/commit/32df540635cacce1053ee0ef98ee23f3f6a43c02
gh-102056: Fix a few bugs in error handling of exception printing code #102078https://github.com/python/cpython/pull/102078
iritkatrielhttps://github.com/iritkatriel
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%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.