René's URL Explorer Experiment


Title: Importing ctypes results in extra open libffi file descriptor since 3.14 · Issue #135893 · python/cpython · GitHub

Open Graph Title: Importing ctypes results in extra open libffi file descriptor since 3.14 · Issue #135893 · python/cpython

X Title: Importing ctypes results in extra open libffi file descriptor since 3.14 · Issue #135893 · python/cpython

Description: Bug report Bug description: On python 3.13 (Fedora), importing ctypes results in the following output from lsfd: python3 893377 daandemeyer mem r-x--- REG 0:37 0 304862113 /usr/lib64/libffi.so.8.1.4 python3 893377 daandemeyer mem r----- ...

Open Graph Description: Bug report Bug description: On python 3.13 (Fedora), importing ctypes results in the following output from lsfd: python3 893377 daandemeyer mem r-x--- REG 0:37 0 304862113 /usr/lib64/libffi.so.8.1....

X Description: Bug report Bug description: On python 3.13 (Fedora), importing ctypes results in the following output from lsfd: python3 893377 daandemeyer mem r-x--- REG 0:37 0 304862113 /usr/lib64/libffi.so.8.1....

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Importing ctypes results in extra open libffi file descriptor since 3.14","articleBody":"# Bug report\n\n### Bug description:\n\nOn python 3.13 (Fedora), importing ctypes results in the following output from `lsfd`:\n\n```\npython3 893377 daandemeyer    mem r-x---  REG   0:37     0  304862113 /usr/lib64/libffi.so.8.1.4\npython3 893377 daandemeyer    mem r-----  REG   0:37     0  304862113 /usr/lib64/libffi.so.8.1.4\npython3 893377 daandemeyer    mem r-----  REG   0:37     0  304862113 /usr/lib64/libffi.so.8.1.4\npython3 893377 daandemeyer    mem rw----  REG   0:37     0  304862113 /usr/lib64/libffi.so.8.1.4\n```\n\nOn python 3.14 (Fedora), importing ctypes results in the following output from `lsfd`:\n\n```\npython3 892407 daandemeyer      5 r-----  REG  0:238  1342       7553 /usr/lib64/libffi.so.8.2.0\n```\n\nThis ended up breaking https://github.com/systemd/mkosi because it relied on the fact that no new regular file descriptors were opened by importing ctypes (on python 3.14 the file descriptor shows up in /proc/self/fd whereas on python 3.13 the file descriptors are memory maps which don't show up in /proc/self/fd). I searched through the commit list and couldn't find the commit that introduced this change. It also didn't seem to be documented in the release notes. Can anyone point me to the commit introducing this change and the reasoning behind it?\n\n### CPython versions tested on:\n\n3.14\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-161844\n* gh-161975\n* gh-161976\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/daandemeyer","@type":"Person","name":"daandemeyer"},"datePublished":"2025-06-24T13:46:34Z","url":"https://github.com/python/cpython/issues/135893"}

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:b618ffa8-296a-52ec-df73-9005311c2e52
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEC60:A70A9:1E3DE08:27D5A58:6B022F5B
html-safe-nonced5efcaf7cf7a3264c1b10d489d56715011033b73c2693ffe389ac6961edd30b7
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQzYwOkE3MEE5OjFFM0RFMDg6MjdENUE1ODo2QjAyMkY1QiIsInZpc2l0b3JfaWQiOiIxODE0NDcyNTk1OTk1NzY2NjE5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmace83d3244732fea9fa3c1728d4f363d649cd4d292eeb26babcbb233ab87d92a03
hovercard-subject-tagissue:3172080363
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/135893/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a08a74b53ea800921ea8cf6a490230e91f6b978116f6c768fd99c89451493621/python/cpython/issues/135893
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a08a74b53ea800921ea8cf6a490230e91f6b978116f6c768fd99c89451493621/python/cpython/issues/135893
og:image:altBug report Bug description: On python 3.13 (Fedora), importing ctypes results in the following output from lsfd: python3 893377 daandemeyer mem r-x--- REG 0:37 0 304862113 /usr/lib64/libffi.so.8.1....
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedaandemeyer
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
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
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/135893#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F135893
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%2Fpython%2Fcpython%2Fissues%2F135893
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=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/135893
Reloadhttps://github.com/python/cpython/issues/135893
Reloadhttps://github.com/python/cpython/issues/135893
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/135893
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/135893
Importing ctypes results in extra open libffi file descriptor since 3.14https://github.com/python/cpython/issues/135893#top
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
topic-ctypeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-ctypes%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/daandemeyer
daandemeyerhttps://github.com/daandemeyer
on Jun 24, 2025https://github.com/python/cpython/issues/135893#issue-3172080363
https://github.com/systemd/mkosihttps://github.com/systemd/mkosi
gh-135893: Lazily initialize the libffi allocator in ctypes #161844https://github.com/python/cpython/pull/161844
[3.15] gh-135893: Lazily initialize the libffi allocator in ctypes (GH-161844) #161975https://github.com/python/cpython/pull/161975
[3.14] gh-135893: Lazily initialize the libffi allocator in ctypes (GH-161844) #161976https://github.com/python/cpython/pull/161976
Nexthttps://github.com/python/cpython/issues/135893?timeline_page=1
daandemeyerhttps://github.com/daandemeyer
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Jun 24, 2025https://github.com/python/cpython/issues/135893#event-18295398082
picnixzhttps://github.com/picnixz
topic-ctypeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-ctypes%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
on Jun 24, 2025https://github.com/python/cpython/issues/135893#event-18295651604
https://github.com/behrmann
behrmannhttps://github.com/behrmann
on Jun 24, 2025https://github.com/python/cpython/issues/135893#issuecomment-3001118635
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 24, 2025https://github.com/python/cpython/issues/135893#issuecomment-3001173337
04d4aachttps://github.com/python/cpython/commit/04d4aacaacbe26146e9b5ff6b0043f86f3c543d4
gh-128485https://github.com/python/cpython/issues/128485
@kumaraditya303https://github.com/kumaraditya303
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 24, 2025https://github.com/python/cpython/issues/135893#issuecomment-3001175749
https://github.com/systemd/mkosihttps://github.com/systemd/mkosi
https://github.com/daandemeyer
daandemeyerhttps://github.com/daandemeyer
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3003795627
https://github.com/systemd/mkosihttps://github.com/systemd/mkosi
https://github.com/daandemeyer
daandemeyerhttps://github.com/daandemeyer
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004087538
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004132904
https://github.com/daandemeyer
daandemeyerhttps://github.com/daandemeyer
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004140272
@behrmannhttps://github.com/behrmann
https://github.com/kumaraditya303
kumaraditya303https://github.com/kumaraditya303
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004287190
daandemeyerhttps://github.com/daandemeyer
on Jun 25, 2025https://github.com/python/cpython/issues/135893#event-18314163682
sandbox: Work around extra file descriptor opened by importing ctypes…https://github.com/daandemeyer/mkosi/commit/68b3ecc5b9812f1de825bb2611467c0d32f9529c
68b3ecchttps://github.com/daandemeyer/mkosi/commit/68b3ecc5b9812f1de825bb2611467c0d32f9529c
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004401665
https://github.com/kumaraditya303
kumaraditya303https://github.com/kumaraditya303
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004436656
https://github.com/daandemeyer
daandemeyerhttps://github.com/daandemeyer
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004481384
daandemeyerhttps://github.com/daandemeyer
on Jun 25, 2025https://github.com/python/cpython/issues/135893#event-18315363318
sandbox: Work around extra file descriptor opened by importing ctypes…https://github.com/daandemeyer/mkosi/commit/694c8d2721cd6d1081caf39641f615aa81d5f8a0
694c8d2https://github.com/daandemeyer/mkosi/commit/694c8d2721cd6d1081caf39641f615aa81d5f8a0
https://github.com/behrmann
behrmannhttps://github.com/behrmann
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004643210
@kumaraditya303https://github.com/kumaraditya303
https://github.com/kumaraditya303
kumaraditya303https://github.com/kumaraditya303
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004657760
https://github.com/behrmann
behrmannhttps://github.com/behrmann
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004720844
@vstinnerhttps://github.com/vstinner
https://github.com/behrmann
behrmannhttps://github.com/behrmann
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3004772215
https://github.com/behrmann
behrmannhttps://github.com/behrmann
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3005012872
Ubuntuhttps://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1108097
Archhttps://gitlab.archlinux.org/archlinux/packaging/packages/libffi/-/blob/2586f930ba581f2df5152c18f71634be2825fea0/PKGBUILD#L32
Fedora for 3.4.4https://src.fedoraproject.org/rpms/libffi/c/6d176a7c520b417352b2341bc68f8242b0c3f6c3?branch=rawhide
libffi/libffi@9ba5592https://github.com/libffi/libffi/commit/9ba559217bea0803263a9a9a0bafcf9203606f5b
@blucahttps://github.com/bluca
libffi/libffi@9ba5592https://github.com/libffi/libffi/commit/9ba559217bea0803263a9a9a0bafcf9203606f5b
https://github.com/bluca
blucahttps://github.com/bluca
on Jun 25, 2025https://github.com/python/cpython/issues/135893#issuecomment-3005013186
libffi/libffi@9ba5592https://github.com/libffi/libffi/commit/9ba559217bea0803263a9a9a0bafcf9203606f5b
https://github.com/daandemeyer
daandemeyerhttps://github.com/daandemeyer
on Jun 26, 2025https://github.com/python/cpython/issues/135893#issuecomment-3007760946
libffi/libffi#926https://github.com/libffi/libffi/pull/926
https://github.com/vstinner
vstinnerhttps://github.com/vstinner
on Jun 19, 2026https://github.com/python/cpython/issues/135893#issuecomment-4750179910
libffi/libffi#926https://github.com/libffi/libffi/pull/926
libffi/libffi@6067118https://github.com/libffi/libffi/commit/60671187688ae3b295ab0e1dd77a8d6dd7a805a2
ZeroIntensityhttps://github.com/ZeroIntensity
[macOS x86_64, python >= 3.14] Process hangs when importing ctypes from embedded interpreter in a x86_64 macOS executable with enabled hardened runtime #160627https://github.com/python/cpython/issues/160627
on Nov 12, 2026https://github.com/python/cpython/issues/135893#event-35862437715
https://github.com/ZeroIntensity
ZeroIntensityhttps://github.com/ZeroIntensity
on Nov 12, 2026https://github.com/python/cpython/issues/135893#issuecomment-6812271785
#161844https://github.com/python/cpython/pull/161844
ZeroIntensityhttps://github.com/ZeroIntensity
on Nov 14, 2026https://github.com/python/cpython/issues/135893#event-36099944552
gh-135893: Lazily initialize the libffi allocator in ctypes (GH-161844)https://github.com/python/cpython/commit/9b633f55e1124697372caaec319a3b7583531a74
gh-135893https://github.com/python/cpython/issues/135893
GH-161844https://github.com/python/cpython/pull/161844
9b633f5https://github.com/python/cpython/commit/9b633f55e1124697372caaec319a3b7583531a74
ZeroIntensityhttps://github.com/ZeroIntensity
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Nov 14, 2026https://github.com/python/cpython/issues/135893#event-36099987983
ZeroIntensityhttps://github.com/ZeroIntensity
on Nov 14, 2026https://github.com/python/cpython/issues/135893#event-36101470213
[3.15] gh-135893: Lazily initialize the libffi allocator in ctypes (G…https://github.com/python/cpython/commit/e57a9891990d9191cd19394c3c03db65b5be042b
gh-135893https://github.com/python/cpython/issues/135893
G…https://github.com/python/cpython/pull/161844
e57a989https://github.com/python/cpython/commit/e57a9891990d9191cd19394c3c03db65b5be042b
[3.14] gh-135893: Lazily initialize the libffi allocator in ctypes (G…https://github.com/python/cpython/commit/ca73314c422fd1303f2152634dba91e2e2e2a7df
gh-135893https://github.com/python/cpython/issues/135893
G…https://github.com/python/cpython/pull/161844
ca73314https://github.com/python/cpython/commit/ca73314c422fd1303f2152634dba91e2e2e2a7df
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/135893
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/135893
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
topic-ctypeshttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-ctypes%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%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.