Do something about PYTHONFAULTHANDLER?
- Lenguaje dominante
- Julia
- Estrellas
- 1.5k
- Forks
- 186
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
It seems at least on Linux, setting the environment variable `PYTHONFAULTHANDLER=1` (enabling a Python-builtin package as of recent versions https://docs.python.org/3/library/faulthandler.html) causes segfaults with PyCall. The MWE I've been using is
```julia
# script.jl
using PyCall
Threads.@sync begin
Threads.@spawn GC.gc(true)
Threads.@spawn GC.gc(true)
end
```
Run `julia --threads=2 script.jl` and its fine, but run `PYTHONFAULTHANDLER=1 julia --threads=2 script.jl` and segfault. Reproduced across multiple systems. More impactful I would say, even in single-threaded mode, `PYTHONFAULTHANDLER=1` will crash the IJulia kernel any time you try to interrupt it. This is the situation I was in, I was on a cluster where the admins enabled this by default since its a really useful Python thing, and just lived without the ability to interrupt IJulia for months without knowing why, which I can attest *really sucks.*
Maybe it would make sense to unset this variable in `PyCall.__init__` and issue a warning that we're currently incompatible? I could submit a PR.
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza en PyCall.__init__ y reproduce el MWE de Julia proporcionado con y sin PYTHONFAULTHANDLER=1. Un cambio completo debería abordar los bloqueos reportados en Linux, incluida la interrupción de un kernel de IJulia, y verificar el comportamiento en la configuración afectada.
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
- Bastante claro
- Aptitud para principiantes
- 35/100