Importing ctypes results in extra open libffi file descriptor since 3.14
まだ誰も着手していません。
- 主要言語
- 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 にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、レポートと同様に lsfd と /proc/self/fd を使用して、Linux 上の Python 3.13 と 3.14 で ctypes のインポートを比較します。libffi が通常のファイルディスクリプターとして表示されるようにする変更について、CPython のコミット履歴を追跡し、その変更の理由と、その挙動に回帰修正またはリリースノートへの記載が必要かどうかを判断します。変更とその理由が明確に特定され、検証されれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- operating-systems
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100