test_c_stack_unwind fails on Linux LoongArch builds
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Python
- Estrellas
- 77.2k
- Forks
- 35.9k
- Métricas de merge de PR
- Métricas de PR pendientes
Descripción
Bug report
Bug description:
On the Linux LoongArch64 platform, the test_c_stack_unwind test fails because CPython's manually implemented frame-pointer unwinding mechanism fails to recognize the LoongArch stack frame layout (as it relies on the default FRAME_POINTER_NEXT_OFFSET and FRAME_POINTER_RETURN_OFFSET). This issue affects builds using both GCC and Clang.
In the LoongArch architecture, the frame pointer points to the caller's stack pointer; the previous frame pointer is stored at fp[-2], and the return address is stored at fp[-1].
Additionally, for CPython builds compiled with Clang, unexpected failures occur in test sections involving the GNU backtrace() function. By default, Clang/LoongArch generates .debug_frame sections but does not generate the .eh_frame unwinding tables required for runtime unwinding of CPython's C objects. Consequently, glibc's backtrace() returns only a single stack frame and cannot unwind through Python stack frames.
Reproducer
GCC build:
../cpython/configure --with-pydebug CC=gcc
make -j8
PYTHON_JIT=0 ./python -m test -v test_c_stack_unwind
clang build:
../cpython/configure --with-pydebug CC=clang
make -j8
PYTHON_JIT=0 ./python -m test -v test_c_stack_unwind
Environment
- CPython main
- Linux LoongArch64
- GCC version: 15.3.0
- Clang 20.1.8
- glibc 2.42
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
- gh-152241
- gh-152578
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Línea de trabajo
Ejecuta PYTHON_JIT=0 ./python -m test -v test_c_stack_unwind en Linux LoongArch64 tanto con GCC como con Clang, y luego inspecciona el desenrollado de punteros de marco implementado manualmente en CPython y las secciones de prueba que usan GNU backtrace(). Se considera completado cuando la prueba reconoce el diseño de marcos de LoongArch y las pruebas de compilación aplicables de Clang dejan de fallar; los PR enlazados gh-152241 y gh-152578 indican que el trabajo ya está en curso.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- c, linux, python
- Área
- compilers, operating-systems, testing-qa
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 25/100