JuliaPy / JuliaPy/PythonCall.jl

at_jl_exit sometimes crashes

未關閉
#764 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
Julia
星號
1.1k
分支
86
平均合併
1 天 22 小時
30 天內合併 PR
3

描述

**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

貢獻指南

這個儲存庫沒有索引到貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。