Importing ctypes results in extra open libffi file descriptor since 3.14
還沒有人認領這個 Issue。
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 35.9k
- PR 合併指標
- PR 指標待擷取
描述
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----- REG 0:37 0 304862113 /usr/lib64/libffi.so.8.1.4
python3 893377 daandemeyer mem r----- REG 0:37 0 304862113 /usr/lib64/libffi.so.8.1.4
python3 893377 daandemeyer mem rw---- REG 0:37 0 304862113 /usr/lib64/libffi.so.8.1.4
On python 3.14 (Fedora), importing ctypes results in the following output from lsfd:
python3 892407 daandemeyer 5 r----- REG 0:238 1342 7553 /usr/lib64/libffi.so.8.2.0
This 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?
CPython versions tested on:
3.14
Operating systems tested on:
Linux
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先,按照報告中的方法,使用 lsfd 和 /proc/self/fd 比較 Linux 上 Python 3.13 和 3.14 中的 ctypes 匯入情況。追蹤 CPython 的提交歷史,找出使 libffi 顯示為普通檔案描述元的變更,然後確定其原因,以及這種行為是否需要回歸修正或發行說明文件。完成的標準是明確識別並驗證該變更及其原因。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- operating-systems
- Issue 類型
- 缺陷
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100