python / python/cpython

`check_extension_modules.py` hangs build due to SIGTTIN

Abierto
#148,240 5 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

build OS-mac type-bug
Lenguaje dominante
Python
Estrellas
77.2k
Forks
35.9k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

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

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza con check_extension_modules.py y la ruta de importación de readline descrita en el informe, incluidos PyInit_readline y get_tty_settings. Reproduce la compilación de macOS con stdin conectado a un tty y, después, inspecciona el PR vinculado gh-148279. Se considera terminado cuando la compilación ya no se bloquea ni suspende el proceso de Python en este escenario.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
build-system, operating-systems
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.