JuliaPy / JuliaPy/PythonCall.jl
Julia crashes on Interrupt when using PythonCall
- 主要言語
- Julia
- スター
- 1.1k
- フォーク
- 86
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 3
説明
**Affects:** PythonCall
**Describe the bug**
I just turned off threads to make PythonCall work, but now I experience that every time I try interrupting the julia REPL (with PythonCall loaded and used inside a WebServer) it results in a fatal error which crashes the whole Julia REPL (however I would like to stay in the julia REPL)
Here the error message
```julia
^Cfatal: error thrown and no exception handler available.
InterruptException()
_jl_mutex_unlock at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/threading.c:805
jl_mutex_unlock at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia_locks.h:81 [inlined]
ijl_task_get_next at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/partr.c:394
poptask at ./task.jl:974
wait at ./task.jl:983
task_done_hook at ./task.jl:672
jfptr_task_done_hook_49546.clone_1 at /usr/local/julia/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined]
jl_finish_task at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/task.c:320
start_task at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/task.c:1103
fatal: error thrown and no exception handler available.
ErrorException("schedule: Task not runnable")
error at ./error.jl:35
#schedule#649 at ./task.jl:840
schedule at ./task.jl:838 [inlined]
notify at ./condition.jl:154
#notify#622 at ./condition.jl:148 [inlined]
notify at ./condition.jl:148 [inlined]
notify at ./condition.jl:148 [inlined]
task_done_hook at ./task.jl:655
jfptr_task_done_hook_49546.clone_1 at /usr/local/julia/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined]
jl_finish_task at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/task.c:320
start_task at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/task.c:1103
┌ Warning: temp cleanup
│ exception =
│ schedule: Task not runnable
│ Stacktrace:
│ [1] error(s::String)
│ @ Base ./error.jl:35
│ [2] enq_work(t::Task)
│ @ Base ./task.jl:769
│ [3] yield
│ @ ./task.jl:882 [inlined]
│ [4] yield
│ @ ./task.jl:880 [inlined]
│ [5] Channel{Tuple{String, Vector{String}, Vector{String}}}(func::Base.Filesystem.var"#28#31"{String}, size::Int64; taskref::Nothing, spawn::Bool)
│ @ Base ./channels.jl:140
│ [6] Channel (repeats 2 times)
│ @ ./channels.jl:132 [inlined]
│ [7] #walkdir#27
│ @ ./file.jl:967 [inlined]
│ [8] walkdir
│ @ ./file.jl:928 [inlined]
│ [9] prepare_for_deletion(path::String)
│ @ Base.Filesystem ./file.jl:507
│ [10] temp_cleanup_purge(; force::Bool)
│ @ Base.Filesystem ./file.jl:542
│ [11] temp_cleanup_purge
│ @ ./file.jl:535 [inlined]
│ [12] (::Base.var"#930#931")()
│ @ Base ./initdefs.jl:354
│ [13] _atexit(exitcode::Int32)
│ @ Base ./initdefs.jl:416
└ @ Base.Filesystem file.jl:547
schedule: Task not runnable
atexit hook threw an error: ErrorException("schedule: Task not runnable")
error at ./error.jl:35
#schedule#649 at ./task.jl:840
schedule at ./task.jl:838 [inlined]
uv_writecb_task at ./stream.jl:1166
jfptr_uv_writecb_task_49483.clone_1 at /usr/local/julia/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jlcapi_uv_writecb_task_31800.clone_1 at /usr/local/julia/lib/julia/sys.so (unknown line)
uv__write_callbacks at /workspace/srcdir/libuv/src/unix/stream.c:959
uv__stream_io at /workspace/srcdir/libuv/src/unix/stream.c:1294
uv__run_pending at /workspace/srcdir/libuv/src/unix/core.c:804
uv_run at /workspace/srcdir/libuv/src/unix/core.c:392
ijl_task_get_next at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/partr.c:390
poptask at ./task.jl:974
wait at ./task.jl:983
uv_write at ./stream.jl:1048
unsafe_write at ./stream.jl:1120
write at ./strings/io.jl:244 [inlined]
print at ./strings/io.jl:246
jfptr_print_33672.clone_1 at /usr/local/julia/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
showerror at ./errorshow.jl:144
unknown function (ip: 0x7f61c41878c6)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
_atexit at ./initdefs.jl:419
jfptr__atexit_46096.clone_1 at /usr/local/julia/lib/julia/sys.so (unknown line)
_jl_invoke at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2758 [inlined]
ijl_apply_generic at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/gf.c:2940
jl_apply at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/julia.h:1880 [inlined]
ijl_atexit_hook at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/init.c:280
ijl_exit at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/init.c:207
ijl_no_exc_handler at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/task.c:712
jl_finish_task at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/task.c:323
start_task at /cache/build/default-amdci5-5/julialang/julia-release-1-dot-9/src/task.c:1103
```
I was not able to simplify it to a MWE yet. Maybe the above error is already somehow self-explaining.
**Your system**
Please provide detailed information about your system:
- The operating system - standard julia docker with non-root user
- Julia 1.9, PythonCall 0.9.14
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
Start by reproducing the crash with Julia 1.9 and PythonCall 0.9.14 in the standard Julia Docker setup, loading PythonCall and using it inside a WebServer before interrupting the Julia REPL. The issue has no minimal reproducer or named source file; done means identifying and preventing the fatal error so the REPL remains usable after an interrupt.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- julia, python
- 領域
- backend, cli
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 25/100