python / python/cpython

`check_extension_modules.py` hangs build due to SIGTTIN

Offen
#148,240 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

build OS-mac type-bug
Vorherrschende Sprache
Python
Sterne
77.2k
Forks
35.9k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit check_extension_modules.py und dem im Bericht beschriebenen readline-Importpfad, einschließlich PyInit_readline und get_tty_settings. Reproduziere den macOS-Build mit an ein tty angeschlossenem stdin und prüfe anschließend den verknüpften PR gh-148279. Erledigt bedeutet, dass der Build in diesem Szenario nicht mehr hängen bleibt oder den Python-Prozess anhält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system, operating-systems
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.