René's URL Explorer Experiment


Title: [Bug]: macosx backend, plots not closing, segfault · Issue #32019 · matplotlib/matplotlib · GitHub

Open Graph Title: [Bug]: macosx backend, plots not closing, segfault · Issue #32019 · matplotlib/matplotlib

X Title: [Bug]: macosx backend, plots not closing, segfault · Issue #32019 · matplotlib/matplotlib

Description: Bug summary I am trying to create a plot in a for-loop. I can move each plot around, but even if I close it (click the ❌, use plt.close()), all prior plots are still displayed behind the newest plot. If I try to close plots (click the ❌)...

Open Graph Description: Bug summary I am trying to create a plot in a for-loop. I can move each plot around, but even if I close it (click the ❌, use plt.close()), all prior plots are still displayed behind the newest plo...

X Description: Bug summary I am trying to create a plot in a for-loop. I can move each plot around, but even if I close it (click the ❌, use plt.close()), all prior plots are still displayed behind the newest plo...

Opengraph URL: https://github.com/matplotlib/matplotlib/issues/32019

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: macosx backend, plots not closing, segfault","articleBody":"### Bug summary\n\nI am trying to create a plot in a for-loop. I can move each plot around, but even if I close it (click the ❌, use `plt.close()`), all prior plots are still displayed behind the newest plot. If I try to close plots (click the ❌) out of order, it results in a segfault.\n\n### Code for reproduction\n\n```Python\nimport numpy as np\nimport matplotlib.pyplot as plt\n\nfor _ in range(100):\n    fig, ax = plt.subplots()\n    x = np.random.rand(10)\n    y = np.random.rand(10)\n    ax.plot(x, y)\n    plt.show()\n    plt.close()\n```\n\n### Actual outcome\n\n```\n\u003e python3 -X faulthandler test.py\nFatal Python error: Segmentation fault\n\nCurrent thread 0x00000001f5cc1e80 (most recent call first):\n  File \"/Users/Adam/torchgeo/.venv/lib/python3.14/site-packages/matplotlib/backends/backend_macosx.py\", line 180 in start_main_loop\n  File \"/Users/Adam/torchgeo/.venv/lib/python3.14/site-packages/matplotlib/backend_bases.py\", line 3702 in show\n  File \"/Users/Adam/torchgeo/.venv/lib/python3.14/site-packages/matplotlib/pyplot.py\", line 646 in show\n  File \"/Users/Adam/Downloads/test.py\", line 9 in \u003cmodule\u003e\n\nCurrent thread's C stack trace (most recent call first):\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at _Py_DumpStack+0x44 [0x101cf10a4]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at faulthandler_dump_c_stack+0x54 [0x101d68f48]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at faulthandler_fatal_error+0x16c [0x101d68df8]\n  Binary file \"/usr/lib/system/libsystem_platform.dylib\", at _sigtramp+0x38 [0x189b4b744]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at _Py_Dealloc+0x38 [0x1013b0238]\n  Binary file \"/Users/Adam/torchgeo/.venv/lib/python3.14/site-packages/matplotlib/backends/_macosx.cpython-314-darwin.so\", at -[Window close]+0x7c [0x106c59f70]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSWindow __close]+0x178 [0x18e2e2ad8]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSApplication(NSResponder) sendAction:to:from:]+0x230 [0x18e1c66c0]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSControl sendAction:to:]+0x48 [0x18e1c6460]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at __26-[NSCell _sendActionFrom:]_block_invoke+0x64 [0x18e1c63a4]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSCell _sendActionFrom:]+0xcc [0x18e1c62cc]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSButtonCell _sendActionFrom:]+0x60 [0x18e1c61c8]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at NSControlTrackMouse+0x5d4 [0x18e1c37b0]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSCell trackMouse:inRect:ofView:untilMouseUp:]+0x90 [0x18e1c31b0]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSButtonCell trackMouse:inRect:ofView:untilMouseUp:]+0xe4 [0x18e1c307c]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSControl(_NSTracking) _mouseDown:]+0x260 [0x18e712a74]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSControl(_NSTracking) mouseDown:]+0x68 [0x18e7127e8]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSWindow(NSEventRouting) _handleMouseDownEvent:isDelayedEvent:]+0xe70 [0x18e1c1c04]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSWindow(NSEventRouting) _reallySendEvent:isDelayedEvent:]+0x1ec [0x18e1501f4]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSWindow(NSEventRouting) sendEvent:]+0x17c [0x18e14fe64]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSApplication(NSEventRouting) sendEvent:]+0x4fc [0x18ebc040c]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSApplication _handleEvent:]+0x3c [0x18e80d664]\n  Binary file \"/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit\", at -[NSApplication run]+0x198 [0x18e01f164]\n  Binary file \"/Users/Adam/torchgeo/.venv/lib/python3.14/site-packages/matplotlib/backends/_macosx.cpython-314-darwin.so\", at show+0x74 [0x106c5e970]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at _TAIL_CALL_CALL_NON_PY_GENERAL.llvm.10127954890374434623+0x104 [0x101705924]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at _PyFunction_Vectorcall+0x338 [0x10167429c]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at method_vectorcall.llvm.1628862021063799139+0x94 [0x1016b7330]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at _TAIL_CALL_CALL_FUNCTION_EX.llvm.10127954890374434623+0x10c [0x101469578]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at _PyEval_Vector+0x30c [0x1014f5d00]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at PyEval_EvalCode+0xa0 [0x10150588c]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at run_mod.llvm.9148091775861049191+0x124 [0x101517a7c]\n  Binary file \"/Users/Adam/.local/share/uv/python/cpython-3.14.4-macos-aarch64-none/lib/libpython3.14.dylib\", at pyrun_file+0xa4 [0x101645880]\n  \u003ctruncated rest of calls\u003e\n\nExtension modules: numpy._core._multiarray_umath, numpy.linalg._umath_linalg, PIL._imaging, kiwisolver._cext, matplotlib.backends._macosx, numpy.random._common, numpy.random.bit_generator, numpy.random._bounded_integers, numpy.random._pcg64, numpy.random._generator, numpy.random._mt19937, numpy.random._philox, numpy.random._sfc64, numpy.random.mtrand (total: 14)\nfish: Job 1, 'python3 -X faulthandler test.py' terminated by signal SIGSEGV (Address boundary error)\n```\n\n### Expected outcome\n\nI would expect no phantom plots and no segfaults.\n\n### Additional information\n\nTried Python 3.13 and 3.14 in fresh uv environments, no luck so far. Happy to try other debugging suggestions.\n\n### Operating system\n\nmacOS Tahoe 26.5.1\n\n### Matplotlib Version\n\n3.11.0\n\n### Matplotlib Backend\n\nmacosx\n\n### Python version\n\n3.14.4\n\n### Jupyter version\n\nN/A\n\n### Installation\n\nuv","author":{"url":"https://github.com/adamjstewart","@type":"Person","name":"adamjstewart"},"datePublished":"2026-07-08T20:22:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":18},"url":"https://github.com/32019/matplotlib/issues/32019"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cffbf135-730e-9400-69be-f5b7fa2fd31c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD2E0:18AAA8:1B0C5C2:2504F1B:6A540124
html-safe-noncec324fe47c826817e01e44b717e50dbbe3f6c5e3232a9230abb8edc63d9398bc6
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMkUwOjE4QUFBODoxQjBDNUMyOjI1MDRGMUI6NkE1NDAxMjQiLCJ2aXNpdG9yX2lkIjoiNzkxODc4NzkwNzMwMDg4NDc3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac2957d68c05464d0a99f43b55024dd0f34969d097a6cec119d105a9c8902542ad
hovercard-subject-tagissue:4840828925
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/matplotlib/matplotlib/32019/issue_layout
twitter:imagehttps://opengraph.githubassets.com/c86b85e0329f5dac51deb930cbcddcfefdad88567afc6cb0f69ca5ea5b7a7cc4/matplotlib/matplotlib/issues/32019
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/c86b85e0329f5dac51deb930cbcddcfefdad88567afc6cb0f69ca5ea5b7a7cc4/matplotlib/matplotlib/issues/32019
og:image:altBug summary I am trying to create a plot in a for-loop. I can move each plot around, but even if I close it (click the ❌, use plt.close()), all prior plots are still displayed behind the newest plo...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameadamjstewart
hostnamegithub.com
expected-hostnamegithub.com
Noneb9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb
turbo-cache-controlno-preview
go-importgithub.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git
octolytics-dimension-user_id215947
octolytics-dimension-user_loginmatplotlib
octolytics-dimension-repository_id1385122
octolytics-dimension-repository_nwomatplotlib/matplotlib
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id1385122
octolytics-dimension-repository_network_root_nwomatplotlib/matplotlib
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
release07a982c1d40157c619b364352b704c3ce66bb332
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/32019#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F32019
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%2Fmatplotlib%2Fmatplotlib%2Fissues%2F32019
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=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/32019
Reloadhttps://github.com/matplotlib/matplotlib/issues/32019
Reloadhttps://github.com/matplotlib/matplotlib/issues/32019
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/32019
matplotlib https://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Please reload this pagehttps://github.com/matplotlib/matplotlib/issues/32019
Notifications https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Fork 8.4k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Star 23k https://github.com/login?return_to=%2Fmatplotlib%2Fmatplotlib
Code https://github.com/matplotlib/matplotlib
Issues 1.1k https://github.com/matplotlib/matplotlib/issues
Pull requests 408 https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality 0 https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
Code https://github.com/matplotlib/matplotlib
Issues https://github.com/matplotlib/matplotlib/issues
Pull requests https://github.com/matplotlib/matplotlib/pulls
Actions https://github.com/matplotlib/matplotlib/actions
Projects https://github.com/matplotlib/matplotlib/projects
Wiki https://github.com/matplotlib/matplotlib/wiki
Security and quality https://github.com/matplotlib/matplotlib/security
Insights https://github.com/matplotlib/matplotlib/pulse
#31855https://github.com/matplotlib/matplotlib/pull/31855
[Bug]: macosx backend, plots not closing, segfaulthttps://github.com/matplotlib/matplotlib/issues/32019#top
#31855https://github.com/matplotlib/matplotlib/pull/31855
GUI: MacOSXhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22GUI%3A%20MacOSX%22
https://github.com/adamjstewart
adamjstewarthttps://github.com/adamjstewart
on Jul 8, 2026https://github.com/matplotlib/matplotlib/issues/32019#issue-4840828925
GUI: MacOSXhttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22GUI%3A%20MacOSX%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.