René's URL Explorer Experiment


Title: [Bug]: 3.10 debug build crashes on interpreter exit · Issue #32509 · matplotlib/matplotlib · GitHub

Open Graph Title: [Bug]: 3.10 debug build crashes on interpreter exit · Issue #32509 · matplotlib/matplotlib

X Title: [Bug]: 3.10 debug build crashes on interpreter exit · Issue #32509 · matplotlib/matplotlib

Description: Bug summary I'm building a full debug Python environment (Python 3.12.4, numpy 2.4.6, pybind 3.1, contourpy 1.3.3, MPL 3.10.9) It seems that when MPL has been imported, the python interpreter shutdown will show a GIL error: Fatal Python ...

Open Graph Description: Bug summary I'm building a full debug Python environment (Python 3.12.4, numpy 2.4.6, pybind 3.1, contourpy 1.3.3, MPL 3.10.9) It seems that when MPL has been imported, the python interpreter shutd...

X Description: Bug summary I'm building a full debug Python environment (Python 3.12.4, numpy 2.4.6, pybind 3.1, contourpy 1.3.3, MPL 3.10.9) It seems that when MPL has been imported, the python interpreter s...

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

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: 3.10 debug build crashes on interpreter exit","articleBody":"### Bug summary\n\nI'm building a full debug Python environment (Python 3.12.4, numpy 2.4.6, pybind 3.1, contourpy 1.3.3, MPL 3.10.9)\n\nIt seems that when MPL has been imported, the python interpreter shutdown will show a GIL error:\n```\nFatal Python error: _PyInterpreterState_GET: the function must be called with the GIL held, after Python initialization and before Python finalization, but the GIL is released (the current Python thread state is NULL)\nPython runtime state: finalizing (tstate=0x00007ffbe152fca0)\n```\nIn release builds, this does not occur, but I suppose it's because there are less asserts on GIL state at shutdown.\n\nWhen debugging, the stack is\n```\n \tKernelBase.dll!00007ff843eb3122()\tUnknown\n \tpython312_d.dll!fatal_error_exit(int status) Line 2778\tC\n \tpython312_d.dll!fatal_error(int fd, int header, const char * prefix, const char * msg, int status) Line 2959\tC\n \tpython312_d.dll!_Py_FatalErrorFunc(const char * func, const char * msg) Line 2975\tC\n \tpython312_d.dll!_PyInterpreterState_GET() Line 131\tC\n \tpython312_d.dll!_Py_DECREF_DecRefTotal() Line 240\tC\n \tft2font_d.cp312-win_amd64.pyd!Py_DECREF(const char * filename, int lineno, _object * op) Line 688\tC++\n \tft2font_d.cp312-win_amd64.pyd!Py_XDECREF(_object * op) Line 798\tC++\n \tft2font_d.cp312-win_amd64.pyd!pybind11::handle::dec_ref() Line 300\tC++\n \tft2font_d.cp312-win_amd64.pyd!pybind11::object::~object() Line 395\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::pair\u003cstd::string const ,pybind11::object>::~pair\u003cstd::string const ,pybind11::object>()\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::pair\u003cstd::string const ,pybind11::object>::`scalar deleting destructor'(unsigned int)\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::_Default_allocator_traits\u003cstd::allocator\u003cstd::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *>>>::destroy\u003cstd::pair\u003cstd::string const ,pybind11::object>>(std::allocator\u003cstd::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *>> & __formal, std::pair\u003cstd::string const ,pybind11::object> * const _Ptr) Line 741\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *>::_Freenode\u003cstd::allocator\u003cstd::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *>>>(std::allocator\u003cstd::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *>> & _Al, std::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *> * _Ptr) Line 318\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *>::_Free_non_head\u003cstd::allocator\u003cstd::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *>>>(std::allocator\u003cstd::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *>> & _Al, std::_List_node\u003cstd::pair\u003cstd::string const ,pybind11::object>,void *> * _Head) Line 329\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::list\u003cstd::pair\u003cstd::string const ,pybind11::object>,std::allocator\u003cstd::pair\u003cstd::string const ,pybind11::object>>>::_Tidy() Line 1519\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::list\u003cstd::pair\u003cstd::string const ,pybind11::object>,std::allocator\u003cstd::pair\u003cstd::string const ,pybind11::object>>>::~list\u003cstd::pair\u003cstd::string const ,pybind11::object>,std::allocator\u003cstd::pair\u003cstd::string const ,pybind11::object>>>() Line 1063\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::_Hash\u003cstd::_Umap_traits\u003cstd::string,pybind11::object,std::_Uhash_compare\u003cstd::string,std::hash\u003cstd::string>,std::equal_to\u003cstd::string>>,std::allocator\u003cstd::pair\u003cstd::string const ,pybind11::object>>,0>>::~_Hash\u003cstd::_Umap_traits\u003cstd::string,pybind11::object,std::_Uhash_compare\u003cstd::string,std::hash\u003cstd::string>,std::equal_to\u003cstd::string>>,std::allocator\u003cstd::pair\u003cstd::string const ,pybind11::object>>,0>>()\tC++\n \tft2font_d.cp312-win_amd64.pyd!std::unordered_map\u003cstd::string,pybind11::object,std::hash\u003cstd::string>,std::equal_to\u003cstd::string>,std::allocator\u003cstd::pair\u003cstd::string const ,pybind11::object>>>::~unordered_map\u003cstd::string,pybind11::object,std::hash\u003cstd::string>,std::equal_to\u003cstd::string>,std::allocator\u003cstd::pair\u003cstd::string const ,pybind11::object>>>()\tC++\n \tft2font_d.cp312-win_amd64.pyd!p11x::`anonymous namespace'::`dynamic atexit destructor for 'enums''()\tC++\n \tucrtbased.dll!00007fff08e62b99()\tUnknown\n \tucrtbased.dll!00007fff08e625c5()\tUnknown\n \tucrtbased.dll!00007fff08e62717()\tUnknown\n \tucrtbased.dll!00007fff08e62d44()\tUnknown\n \tft2font_d.cp312-win_amd64.pyd!__scrt_dllmain_uninitialize_c() Line 398\tC++\n>\tft2font_d.cp312-win_amd64.pyd!dllmain_crt_process_detach(const bool is_terminating) Line 182\tC++\n \tft2font_d.cp312-win_amd64.pyd!dllmain_crt_dispatch(HINSTANCE__ * const instance, const unsigned long reason, void * const reserved) Line 220\tC++\n \tft2font_d.cp312-win_amd64.pyd!dllmain_dispatch(HINSTANCE__ * const instance, const unsigned long reason, void * const reserved) Line 293\tC++\n \tft2font_d.cp312-win_amd64.pyd!_DllMainCRTStartup(HINSTANCE__ * const instance, const unsigned long reason, void * const reserved) Line 335\tC++\n \tntdll.dll!00007ff84667ef6a()\tUnknown\n \tntdll.dll!00007ff84657b2e3()\tUnknown\n \tntdll.dll!00007ff8465e027f()\tUnknown\n \tntdll.dll!00007ff8465def8e()\tUnknown\n \tkernel32.dll!00007ff8447a17ab()\tUnknown\n \tucrtbased.dll!00007fff08e6219b()\tUnknown\n \tucrtbased.dll!00007fff08e6214f()\tUnknown\n \tucrtbased.dll!00007fff08e62456()\tUnknown\n \tpython_d.exe!__scrt_common_main_seh() Line 295\tC++\n \tpython_d.exe!__scrt_common_main() Line 331\tC++\n \tpython_d.exe!wmainCRTStartup(void * __formal) Line 17\tC++\n \tkernel32.dll!00007ff84478dda7()\tUnknown\n \tntdll.dll!00007ff8465dee4c()\tUnknown\n```\n\nIt seems the enums map is deleted in scalar destructor at exit, far too late for python, and the decref crashes because of it.\n\nAs a workaround, since the object is not properly deleted anyways,\nyou can replace the line of _enums.h:\n`auto enums = std::unordered_map\u003cstd::string, py::object>{};`\nby\n`auto& enums = *new std::unordered_map\u003cstd::string, py::object>{};`\nSo no delete attempt is done, and the problem disappears\n\nCode changed in 3.11, so i suppose this only affects 3.10.x\n\n### Code for reproduction\n\n```Python\npython_d -c \"import matplotlib\"\n```\n\n### Actual outcome\n\nFatal Python error: _PyInterpreterState_GET: the function must be called with the GIL held, after Python initialization and before Python finalization, but the GIL is released (the current Python thread state is NULL)\nPython runtime state: finalizing (tstate=0x00007ffbe152fca0)\n\n### Expected outcome\n\nProcess imports matplotlib and finished without a GIL error\n\n### Additional information\n\n_No response_\n\n### Operating system\n\nWINdows 11\n\n### Matplotlib Version\n\n3.10.9\n\n### Matplotlib Backend\n\nbackend independant\n\n### Python version\n\n3.12.4 debug build\n\n### Jupyter version\n\n_No response_\n\n### Installation\n\nfrom source (.tar.gz)","author":{"url":"https://github.com/bartoli","@type":"Person","name":"bartoli"},"datePublished":"2026-10-20T13:01:37Z","url":"https://github.com/matplotlib/matplotlib/issues/32509"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d3f600e0-3ff1-3a48-f3b1-c46498916a44
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD47C:D37F7:EF0CEF:13FC5B0:6B064EA3
html-safe-nonce119dff6128ee029b6964aa532f8d1190eead13edb1181ece981681371194e392
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENDdDOkQzN0Y3OkVGMENFRjoxM0ZDNUIwOjZCMDY0RUEzIiwidmlzaXRvcl9pZCI6IjU4MDQ2NjMyNDQ1MzA3OTgyNDMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac40f03e6c93db6adde717c4a0dcb309ebb88671200ae0475f9f322122c491c029
hovercard-subject-tagissue:5942107918
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/32509/issue_layout
twitter:imagehttps://opengraph.githubassets.com/543ec3cff6faac6029b2ee1eb01d96a8d1672374ce2839a09afcadd04637bf0c/matplotlib/matplotlib/issues/32509
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/543ec3cff6faac6029b2ee1eb01d96a8d1672374ce2839a09afcadd04637bf0c/matplotlib/matplotlib/issues/32509
og:image:altBug summary I'm building a full debug Python environment (Python 3.12.4, numpy 2.4.6, pybind 3.1, contourpy 1.3.3, MPL 3.10.9) It seems that when MPL has been imported, the python interpreter shutd...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebartoli
hostnamegithub.com
expected-hostnamegithub.com
None772b6997ca4daa0428dd49a25d76052e765555ae560fe9c88517eb828bbd861e
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
releasef1f9a08f7c769a37f1dfc18ad43d463c222a7eea
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/matplotlib/matplotlib/issues/32509#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F32509
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%2Fmatplotlib%2Fmatplotlib%2Fissues%2F32509
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=matplotlib%2Fmatplotlib
Reloadhttps://github.com/matplotlib/matplotlib/issues/32509
Reloadhttps://github.com/matplotlib/matplotlib/issues/32509
Reloadhttps://github.com/matplotlib/matplotlib/issues/32509
matplotlibhttps://github.com/matplotlib
matplotlibhttps://github.com/matplotlib/matplotlib
Codehttps://github.com/matplotlib/matplotlib
Issues1k (1k)https://github.com/matplotlib/matplotlib/issues
Pull requests430 (430)https://github.com/matplotlib/matplotlib/pulls
Actionshttps://github.com/matplotlib/matplotlib/actions
Projectshttps://github.com/matplotlib/matplotlib/projects
Wikihttps://github.com/matplotlib/matplotlib/wiki
Security and qualityhttps://github.com/matplotlib/matplotlib/security
Insightshttps://github.com/matplotlib/matplotlib/insights
https://github.com/matplotlib/matplotlib
New issuehttps://github.com/login?return_to=https://github.com/matplotlib/matplotlib/issues/32509
New issuehttps://github.com/login?return_to=https://github.com/matplotlib/matplotlib/issues/32509
[Bug]: 3.10 debug build crashes on interpreter exithttps://github.com/matplotlib/matplotlib/issues/32509#top
topic: text/fontshttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20text%2Ffonts%22
https://github.com/bartoli
bartolihttps://github.com/bartoli
on Oct 20, 2026https://github.com/matplotlib/matplotlib/issues/32509#issue-5942107918
iccirhttps://github.com/iccir
topic: text/fontshttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20text%2Ffonts%22
on Oct 20, 2026https://github.com/matplotlib/matplotlib/issues/32509#event-33756272052
https://github.com/iccir
iccirhttps://github.com/iccir
on Oct 20, 2026https://github.com/matplotlib/matplotlib/issues/32509#issuecomment-6294610417
Sign up for freehttps://github.com/signup?return_to=https://github.com/matplotlib/matplotlib/issues/32509
Sign in to commenthttps://github.com/login?return_to=https://github.com/matplotlib/matplotlib/issues/32509
topic: text/fontshttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22topic%3A%20text%2Ffonts%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

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.