Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Crashes with Julia 1.12 and Revise.jl

未关闭
#1,095 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

@topolarity 已经在做这个了。

开始于 2026年3月10日。

  • #1097 来自 @topolarity —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
需要澄清
活跃度
冷清
技术栈
python
领域
backend

调研方向

首先复现 issue 中展示的使用 Revise 和 PyPlot 的 Julia REPL 操作序列。阅读 Revise 的 src/visit.jl 和 src/packagedef.jl,然后阅读 PyCall 中 pydecref 附近的 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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

JuliaPy/PyCall.jl 的其他 Issue

查看 JuliaPy/PyCall.jl 的全部 Issue

相似的 Issue

更多 Julia Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。