JuliaPy / JuliaPy/PythonCall.jl

at_jl_exit sometimes crashes

Abierto
#764 0 comentarios 0 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
Julia
Estrellas
1.1k
Forks
86
Merge medio
1 d 22 h
PR fusionados (30 d)
3

Descripción

**Affects:** JuliaCall

**Describe the bug**
When running multithreaded julia, python sometimes causes segmentation fault at exit.

**Your system**
Please provide detailed information about your system:
- Ubuntu 25.10
- Julia 1.12.6, Python 3.14.4, PythonCall 0.9.31, JuliaCall 0.9.31

**Additional context**

jl_atexit_hook(0) does three things in sequence:

1. Run user atexit hooks (Base._atexit(0)).
2. Schedule + run ALL registered finalizers (jl_gc_run_all_finalizers).
3. Tear down threads, set jl_gc_disable_counter = 1.

Finalizers are best-effort, and running them during shutdown with multiple threads is probably where the crashes come from. Since the process is exiting, the finalizers don't semantically need to run — they're unsafe and not useful.
I tested that with only `Base._atexit(0), my custom julia `atexit` lambdas are executed

Fixed by https://github.com/JuliaPy/PythonCall.jl/pull/763

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Review jl_atexit_hook(0), Base._atexit(0), and jl_gc_run_all_finalizers to understand the shutdown sequence described in the report. Compare the behavior and available tests with the fix in PythonCall.jl pull request 763; this issue is already marked as fixed there.

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

Evaluación

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

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.