René's URL Explorer Experiment


Title: [Bug]: Umbrella issue: matplotlib Free-threaded Extension Analysis Report · Issue #32073 · matplotlib/matplotlib · GitHub

Open Graph Title: [Bug]: Umbrella issue: matplotlib Free-threaded Extension Analysis Report · Issue #32073 · matplotlib/matplotlib

X Title: [Bug]: Umbrella issue: matplotlib Free-threaded Extension Analysis Report · Issue #32073 · matplotlib/matplotlib

Description: Companion issue to #31424, report as of d7bc494: Findings by Priority Findings use global, non-restarting numbers (1–8). The same numbers are used in Recommendations. RACE Findings (fix immediately) — 1 # Finding File:Line Severity Agent...

Open Graph Description: Companion issue to #31424, report as of d7bc494: Findings by Priority Findings use global, non-restarting numbers (1–8). The same numbers are used in Recommendations. RACE Findings (fix immediately...

X Description: Companion issue to #31424, report as of d7bc494: Findings by Priority Findings use global, non-restarting numbers (1–8). The same numbers are used in Recommendations. RACE Findings (fix immediately...

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

X: @github

direct link

Domain: Github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Bug]: Umbrella issue: matplotlib Free-threaded Extension Analysis Report","articleBody":"Companion issue to #31424, report as of https://github.com/matplotlib/matplotlib/commit/d7bc4947e56f96fc2bc275b98b4270a21d9b7a4c:\n\n## Findings by Priority\n\nFindings use **global, non-restarting numbers** (1–8). The same numbers are used in Recommendations.\n\n### RACE Findings (fix immediately) — 1\n\n| # | Finding | File:Line | Severity | Agents |\n|---|---------|-----------|----------|--------|\n| 1 | **Global `FT_Library _ft2Library` shared across all threads.** Face creation `FT_Open_Face` and destruction `FT_Done_Face` mutate the library's internal face list and memory manager with no lock. FreeType is not thread-safe on a shared `FT_Library`. **Survives the Python thread-keyed font cache** — even a per-thread `FT2Font` is created/destroyed on the one shared library. | `ft2font.cpp:19` (decl), `:200` (`FT_Open_Face`), `:223` (`FT_Done_Face`); `ft2font.h:100` (extern) | **CRITICAL** | shared-state, unsafe-api, lock-discipline, STW (corroborated); orchestrator-verified |\n\n### UNSAFE Findings (fix before declaring free-threading support) — 2\n\n| # | Finding | File:Line | Severity |\n|---|---------|-----------|----------|\n| 2 | **Per-object `FT_Face` mutation via FreeType glyph/charmap/size calls.** `FT_Load_Glyph`, `FT_Set_Charmap`, `FT_Select_Charmap`, `FT_Set_Char_Size` (and `raqm_set_freetype_face`, which binds the same face) mutate the shared `face-\u003eglyph` slot. Unsafe if a single `FT2Font` is used from multiple threads. Latent in matplotlib's default path (thread-keyed cache) but **fully reachable via direct `ft2font.FT2Font(...)` use**, which the GIL-free opt-in explicitly permits. | `ft2font.cpp:249, 275, 280, 477, 556, 606, 642`; `ft2font.cpp:325, 402` (raqm binds face); `ft2font_wrapper.cpp:1770` | **HIGH** |\n| 3 | **`_tkagg` calls Tcl/Tk C API under `mod_gil_not_used()`.** `Tk_PhotoPutBlock` / `Tcl_SetVar` / `Tcl_SetVar2` operate on a `Tcl_Interp`, but Tcl interpreters are thread-apartment-bound and Tk is not free-threading-safe. Calling `blit` from a non-owning thread is undefined. | `_tkagg.cpp:102, 137, 176–184` | **MEDIUM** |\n\n### PROTECT Findings (add synchronization) — 3\n\n| # | Finding | File:Line | Severity |\n|---|---------|-----------|----------|\n| 4 | **`FT2Font` per-object mutable state cluster** — `face`, `glyphs`, `char_to_font`, `fallbacks`, `bbox`, `pen`, `image`, `kerning_factor`, `warn_if_used`. Mutated by nearly every method with no lock. The lock-discipline scanner flagged **17 `critical_section_candidate`s** here. Note the fallback design: an `FT2Font` holds `std::vector\u003cFT2Font*\u003e fallbacks` — if fonts were ever shared across threads, a fallback would be mutated concurrently by multiple parents. (Currently constrained per-thread by the font cache.) | `ft2font.h:183–193` (members); `ft2font_wrapper.cpp` ×17 (e.g. `:319`) | **HIGH** (latent) |\n| 5 | **`RendererAgg` / `BufferRegion` per-object state** — the lock-discipline scanner flagged **10 `critical_section_candidate`s** in the Agg wrapper (per-object buffer/attribute accessors). Safe only while a renderer/buffer is not shared across threads; needs a per-object guard otherwise. | `_backend_agg_wrapper.cpp` ×10 (e.g. `:17`) | **MEDIUM** |\n| 6 | **Write-once/lazy-init global caches.** `_tkagg` caches Tk/Tcl entry points in statics `TK_FIND_PHOTO`, `TK_PHOTO_PUT_BLOCK`, `TCL_SETVAR`, `TCL_SETVAR2` populated via `dlsym`; and `_macosx.m` holds many mutable `static` globals (`backend_inited`, `lastCommand`, …). Verify the Tk pointers are populated exactly once at import (not lazily under a race), and that the `_macosx` globals are confined to the AppKit main thread. | `_tkagg.cpp:90–95, 255–265`; `_macosx.m:61–73, 263` | **LOW** |\n\n### MIGRATE Findings (structural changes) — 2\n\n| # | Finding | File:Line | Severity |\n|---|---------|-----------|----------|\n| 7 | **No synchronization primitive exists despite a project-wide GIL-free opt-in.** Introduce a dedicated `std::mutex` guarding all `_ft2Library` access (Finding 1) and per-object guards for `FT2Font`/`RendererAgg` (Findings 4–5). Use `py::scoped_critical_section` (`\u003cpybind11/critical_section.h\u003e`) where Python objects are involved and a plain `std::mutex` for the pure-C FreeType resource. | project-wide (`src/`) | **MEDIUM** |\n| 8 | **`mod_gil_not_used()` asserted before it is enforced.** Until Findings 1–5 are addressed, the thread-safety assertion on all eight modules is unsound. Either gate the declarations behind the fixes or document the runtime contract (e.g. \"one thread per `FT2Font`/`RendererAgg` object\"). | all wrapper `PYBIND11_MODULE` lines | **MEDIUM** |\n\nhttps://gist.github.com/clin1234/6cdb5150ba3298576ca54fa07c017517#file-matplotlib-md","author":{"url":"https://github.com/clin1234","@type":"Person","name":"clin1234"},"datePublished":"2026-07-19T13:52:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/32073/matplotlib/issues/32073"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ec51e150-8aa6-588a-bc27-4ecee6da00e9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBF5A:240318:FDB605:16BFC64:6A6335F4
html-safe-nonce4758275d3d602fe08026d36c2828ced7c67a7b2d26f88c79950aff0a7d312f59
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjVBOjI0MDMxODpGREI2MDU6MTZCRkM2NDo2QTYzMzVGNCIsInZpc2l0b3JfaWQiOiI2NTUwMDIwODc1NjE0MzY5MjY4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacbba59fc1307f0cf5ef01b0c9cc17d11a55c2cd6a2b5fad159fd7e01ca4a20f64
hovercard-subject-tagissue:4922929913
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/32073/issue_layout
twitter:imagehttps://opengraph.githubassets.com/700960dff75a807b3ac7a671aa4ec05bb99853f93a504f0ced0b288f5a01b630/matplotlib/matplotlib/issues/32073
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/700960dff75a807b3ac7a671aa4ec05bb99853f93a504f0ced0b288f5a01b630/matplotlib/matplotlib/issues/32073
og:image:altCompanion issue to #31424, report as of d7bc494: Findings by Priority Findings use global, non-restarting numbers (1–8). The same numbers are used in Recommendations. RACE Findings (fix immediately...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameclin1234
hostnamegithub.com
expected-hostnamegithub.com
None59e55daad7174ca59d63c6974d58276ccb5477442e550bebb3c035e1bef11c94
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
release990295d92a4cc7b63fbbd83a046217cd7d77d49c
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://Github.com/matplotlib/matplotlib/issues/32073#start-of-content
https://Github.com/
Sign in https://Github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmatplotlib%2Fmatplotlib%2Fissues%2F32073
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
Code QualityEnforce quality at mergehttps://github.com/features/code-quality
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%2F32073
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/32073
Reloadhttps://Github.com/matplotlib/matplotlib/issues/32073
Reloadhttps://Github.com/matplotlib/matplotlib/issues/32073
Please reload this pagehttps://Github.com/matplotlib/matplotlib/issues/32073
matplotlib https://Github.com/matplotlib
matplotlibhttps://Github.com/matplotlib/matplotlib
Please reload this pagehttps://Github.com/matplotlib/matplotlib/issues/32073
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 419 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
[Bug]: Umbrella issue: matplotlib Free-threaded Extension Analysis Reporthttps://Github.com/matplotlib/matplotlib/issues/32073#top
Maintenancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Maintenance%22
https://github.com/clin1234
clin1234https://github.com/clin1234
on Jul 19, 2026https://github.com/matplotlib/matplotlib/issues/32073#issue-4922929913
#31424https://github.com/matplotlib/matplotlib/issues/31424
d7bc494https://github.com/matplotlib/matplotlib/commit/d7bc4947e56f96fc2bc275b98b4270a21d9b7a4c
https://gist.github.com/clin1234/6cdb5150ba3298576ca54fa07c017517#file-matplotlib-mdhttps://gist.github.com/clin1234/6cdb5150ba3298576ca54fa07c017517#file-matplotlib-md
Maintenancehttps://github.com/matplotlib/matplotlib/issues?q=state%3Aopen%20label%3A%22Maintenance%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.