Crashes with Julia 1.12 and Revise.jl
評価
調査の方向性
まず、issue に示されている Revise と PyPlot を使った Julia REPL のシーケンスを再現します。Revise の src/visit.jl と src/packagedef.jl を読み、次に pydecref 周辺の PyCall の src/PyCall.jl を読み、報告された Julia 1.12 と Python のスタックフレームと比較します。再現可能な segmentation fault が切り分けられ、示されたセットアップで発生しなくなれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I have been using PyPlot (with PyCall) with Revise.jl quite well in the past years, but after the upgrade to Julia 1.12 I see now constant crashes. I've tried to debug these, but they happen quite randomly. I was about to point the issue as happening only in IJulia kernels, when I started seeing them in Julia REPL as well.
These crashes can happen whenever, and are not related to calling "plot" functions.
I have tried reinstalling PyCall and PyPlot with ENV["PYTHON"] = "" (today) and verified the installation happens with a clean Conda.jl environment.
Here is an example of simple commands that trigger the crash:
$ julia
_
_ _ _(_)_ | Documentation: https://docs.julialang.org
(_) | (_) (_) |
_ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ _` | |
| | |_| | | | (_| | | Version 1.12.3 (2025-12-15)
_/ |\__'_|_|_|\__'_| | Official https://julialang.org release
|__/ |
julia> using Base.Threads
julia> threadpool()
:interactive
julia> nthreads()
1
julia> Threads.nthreads(:default)
1
julia> using Revise
julia> using PyPlot
[857707] signal 11 (1): Segmentation fault
in expression starting at REPL[6]:1
_PyInterpreterState_GET at /usr/local/src/conda/python-3.12.12/Include/internal/pycore_pystate.h:133 [inlined]
notify_code_watchers at /usr/local/src/conda/python-3.12.12/Objects/codeobject.c:32
code_dealloc at /usr/local/src/conda/python-3.12.12/Objects/codeobject.c:1705
pydecref_ at /home/mazza/.julia/packages/PyCall/1gn3u/src/PyCall.jl:118 [inlined]
pydecref at /home/mazza/.julia/packages/PyCall/1gn3u/src/PyCall.jl:123
jfptr_pydecref_8808 at /home/mazza/.julia/compiled/v1.12/PyCall/GkzkC_o0cEr.so (unknown line)
run_finalizer at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/gc-common.c:180
jl_gc_run_finalizers_in_list at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/gc-common.c:270
run_finalizers at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/gc-common.c:316
ijl_gc_collect at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/gc-stock.c:3483
maybe_collect at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/gc-stock.c:349 [inlined]
ijl_gc_managed_malloc at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/gc-stock.c:3811
jl_alloc_genericmemory_unchecked at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/genericmemory.c:38
_new_genericmemory_ at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/genericmemory.c:68 [inlined]
jl_alloc_genericmemory at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/genericmemory.c:101
ijl_array_grow_end at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/array.c:222
_append_symbol_to_bindings_array at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/module.c:1958 [inlined]
append_module_names at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/module.c:1980
ijl_module_names at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/module.c:2001
#unsorted_names#4 at ./runtime_internals.jl:119 [inlined]
unsorted_names at ./runtime_internals.jl:119 [inlined]
#names#3 at ./runtime_internals.jl:118 [inlined]
names at ./runtime_internals.jl:118 [inlined]
_subtypes_in! at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/InteractiveUtils/src/InteractiveUtils.jl:266
subtypes at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/InteractiveUtils/src/InteractiveUtils.jl:303 [inlined]
_foreach_subtype! at /home/mazza/.julia/packages/Revise/icvyF/src/visit.jl:43
_foreach_subtype! at /home/mazza/.julia/packages/Revise/icvyF/src/visit.jl:49
_foreach_subtype! at /home/mazza/.julia/packages/Revise/icvyF/src/visit.jl:49
foreach_subtype at /home/mazza/.julia/packages/Revise/icvyF/src/visit.jl:38 [inlined]
#__init__##2 at /home/mazza/.julia/packages/Revise/icvyF/src/packagedef.jl:1658
unknown function (ip: 0x7f711c6a894f) at (unknown file)
jl_apply at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/julia.h:2391 [inlined]
start_task at /cache/build/tester-amdci4-9/julialang/julia-release-1-dot-12/src/task.c:1249
Allocations: 5202189 (Pool: 5202112; Big: 77); GC: 7
Segmentation fault (core dumped)
- 主要言語
- Julia
- スター
- 1.5k
- フォーク
- 186
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaPy/PyCall.jl のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
Meta-Issue: Mutli-threading leads to segfaults対応中かも @topolarity が 212 日前に担当しました。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
JuliaPy/PyCall.jl の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
oxfordcontrol/COSMO.jl#211 ·
-
documentation
難易度 2/5 半日 初心者へのやさしさ 65/100
メンテナーはふだん 6 日以内に返信
-
ARKODE: callbacks that modify `u` throw MethodError on reinit対応中かも @devmotion が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
SciML/Sundials.jl#575 ·
-
broken links in docsオープン
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Tube(N) builds N TubeBase segments of length L/(N−1): total friction/inertia length is N·L/(N−1)対応中かも @ChrisRackauckas-Claude が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
SciML/ModelingToolkitStandardLibrary.jl#525 ·
メンテナーはふだん 1 日以内に返信