python / python/cpython

`check_extension_modules.py` hangs build due to SIGTTIN

オープン
#148,240 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

build OS-mac type-bug
主要言語
Python
スター
77.2k
フォーク
35.9k
PR マージ指標
PR 指標を取得中

説明

Bug description:

When building Python on macOS with stdin a tty and linking against GNU readline, the build hangs indefinitely.

This is because during the build, python.exe -E check_extension_modules.py is run, which attempts to import the readline module.

At import time of the readline module

  • it runs PyInit_readline
  • which calls get_tty_settings from libreadline.dylib,
  • which ultimately runs an ioctl syscall
  • which immediately suspends the Python process thanks to a SIGTTIN signal.

The Python process isn't supposed to run ioctl syscalls from the background.

I don't know where the fix should go, but I would say it's two separate issues:

  • importing modules during the build sounds like a bad idea due to possible side-effects
  • the readline module running an ioctl call during import risking the process to be suspended when backgrounded sounds bad too.
CPython versions tested on:

3.14, main branch at commit 2c8f26cf5c6ff2398f1e1ed8bfe18e9938bbdebd

Operating systems tested on:

macOS

Linked PRs
  • gh-148279

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

check_extension_modules.py と、レポートで説明されている readline のインポートパス(PyInit_readline と get_tty_settings を含む)から始めます。stdin を tty に接続した状態で macOS のビルドを再現し、その後、関連付けられた PR gh-148279 を調査します。このシナリオでビルドがハングしたり Python プロセスを停止したりしなくなれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system, operating-systems
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。