Segfault in `jl_object_id__cold` on Julia 1.11
I have been seeing random segfaults on CI runs for PySR for Julia 1.11 + PythonCall.jl + Python 3.13 for the past several months. For example: https://github.com/MilesCranmer/PySR/actions/runs/14533490695/job/40777540350. I do not recall seeing this specific segfault when using Python 3.10-3.12. It has been going on for a while, but wanted to wait to see if it went away – it has not, and Python 3.13 has started to increase in usage, so I am trying to prioritise fixing it.
At the moment I only see it happening on macos-latest. I used to see it a couple of months ago on windows-latest and also ubuntu-latest. I am not sure if there is a specific pattern. Some days all the CI seems to run fine, other times there are two+ failing jobs. You can see the history of nightly runs here – most of the failing jobs are due to such segfaults. (Note that julia is installed from the binary; the conda-forge is just used for Python. I don't believe conda to be related.)
The actual error traceback is:
[2916] signal 11 (2): Segmentation fault: 11
in expression starting at none:0
jl_object_id__cold at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/builtins.c:441
smallintset_rehash at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/smallintset.c:218
Shown in detail below.
I wonder if this is related to https://github.com/JuliaLang/julia/issues/57333 which was closed after being fixed in https://github.com/JuliaLang/julia/pull/57392 on Julia 1.12. Perhaps a backport be needed on Julia 1.11 @vtjnash?
Here is the full traceback from [this CI run](https://github.com/MilesCranmer/PySR/actions/runs/14533490695/job/40777540350)
[2916] signal 11 (2): Segmentation fault: 11
in expression starting at none:0
jl_object_id__cold at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/builtins.c:441
smallintset_rehash at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/smallintset.c:218
jl_smallintset_insert at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/smallintset.c:197
jl_idset_put_idx at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/./idset.c:104
jl_as_global_root at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/staticdata.c:2548
inst_datatype_inner at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/jltypes.c:2115
inst_type_w_ at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/jltypes.c:2584
ijl_instantiate_unionall at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/jltypes.c:1487 [inlined]
ijl_apply_type at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/jltypes.c:1421
widenconst at ./compiler/typelattice.jl:700
jfptr_widenconst_37429.1 at /Users/runner/miniconda3/envs/pysr-test/julia_env/pyjuliapkg/install/lib/julia/sys.dylib (unknown line)
#408 at ./compiler/typeutils.jl:51
anymap at ./compiler/utilities.jl:43 [inlined]
argtypes_to_type at ./compiler/typeutils.jl:51
abstract_call_known at ./compiler/abstractinterpretation.jl:2199
abstract_call at ./compiler/abstractinterpretation.jl:2282
abstract_call at ./compiler/abstractinterpretation.jl:2275
abstract_call at ./compiler/abstractinterpretation.jl:2423
abstract_eval_call at ./compiler/abstractinterpretation.jl:2438
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2454
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2752
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3044
typeinf_local at ./compiler/abstractinterpretation.jl:3331
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3413
_typeinf at ./compiler/typeinfer.jl:244
typeinf at ./compiler/typeinfer.jl:215
typeinf_edge at ./compiler/typeinfer.jl:923
abstract_call_method at ./compiler/abstractinterpretation.jl:660
abstract_call_gf_by_type at ./compiler/abstractinterpretation.jl:102
abstract_call_known at ./compiler/abstractinterpretation.jl:2200
abstract_call at ./compiler/abstractinterpretation.jl:2282
abstract_call at ./compiler/abstractinterpretation.jl:2275
abstract_call at ./compiler/abstractinterpretation.jl:2423
abstract_eval_call at ./compiler/abstractinterpretation.jl:2438
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2454
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2752
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:3068
typeinf_local at ./compiler/abstractinterpretation.jl:3331
builtin_exec at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
cfunction_vectorcall_FASTCALL_KEYWORDS at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
object_vacall at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyObject_CallMethodObjArgs at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyImport_ImportModuleLevelObject at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyEval_EvalCode at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
builtin_exec at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
cfunction_vectorcall_FASTCALL_KEYWORDS at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
object_vacall at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyObject_CallMethodObjArgs at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyImport_ImportModuleLevelObject at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyEval_EvalCode at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
run_eval_code_obj at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
run_mod at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyRun_SimpleStringFlagsWithName at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
Py_RunMain at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
pymain_main at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
main at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
Allocations: 2925273 (Pool: 2925102; Big: 171); GC: 4
/Users/runner/work/_temp/a299f5a8-12f5-49f2-b61d-eb4071b29970.sh: line 2: 2916 Segmentation fault: 11 python -c "import pysr"
Error: Process completed with exit code 139.
I unfortunately cannot reproduce this locally. But it happens frequently enough in CI that it seems worth fixing. Tips to get a reproducer are appreciated.
I also have nightly CI that runs on Python 3.12, across operating systems, and I see no such errors: https://github.com/MilesCranmer/PySR/actions/runs/14548066793. It is only interactions with 3.13 that cause such errors. PySR connects Julia to Python using juliacall 0.9.24.
Also tagging @cjdoris in case you have any insight into this.
Hello all,
We are running into this much more frequently now. Our macOS jobs for PySR fail more often than they pass. Not sure what to do.
Could perhaps @vtjnash or @xal-0 (or maybe @KristofferC) provide some tips on debugging this? Specifically, what is jl_object_id__cold, and how might we track down the root cause?
Thanks!
My strategy would be a debug build of Julia and then using rr to record a crashing execution and reverse follow the pointer to see what object is getting lost. This is likely someone missing a root for an object
Thanks. Unfortunately using rr with julia and python is not possible at the moment: https://github.com/JuliaLang/julia/issues/52689.
Any other tips?
It's weird because it seems to crash during precompilation, not even during the heavy integration tests start.
Instead of using --bug-report=rr, could you manually start Julia under rr?
Or, rather, manually start Python under rr?
Do have a standalone reproducer? Likely something with a "simulated" low memory environment, sometimes spurious sprinkling of GC.gc() helps.
To clarify, I haven't been able to reproduce it locally yet.
Since the crash on the GH action seems to happen during startup/precompilation, I am not sure I can manually force GC anywhere when trying to reproduce locally. Any other ideas?
Only that https://github.com/JuliaLang/julia/issues/58475 is hopefully the same
To clarify, I haven't been able to reproduce it locally yet.
Without a reproducer, we are all just staring into the fog, trying to see the shape of the pirate ship.
The only thing to attempt is to try and apply the scientific method and try to eliminate one thing after another, e.g. what is different about your local system and CI? https://github.com/JuliaLang/julia/issues/58475 does not reproduce for me on Linux, and from your experience report it does seem to perhaps be a mac issue?
Is it an issue with Julia or PythonCall.jl? It is not excluded that it is a Julia issue, but since PythonCall is doing something non-trivial with Julia memory it is also not clear to me that it is a Julia issue.
My hypothesis is that this is a lost GC root issue, likely from Python keeping a Julia reference longer that it should and this materializes as a memory corruption.
On Linux I can do things like https://unix.stackexchange.com/questions/44985/limit-memory-usage-for-a-single-linux-process to reduce the available memory to a process, but the goal of that action is force GC runs so that any lost root shows up much sooner.
One other strategy is to tear PythonCall.jl open an insert GC.gc() into the initialization everywhere. But of course, this is non-trivial in many ways and it would be much easier to use rr (albeit that does not exist under Mac).
If we had a reproducer, we could also rebuild Julia with https://github.com/JuliaLang/julia/blob/720d0f5fa08d46017075e6159aea9a5d56935cf5/Make.inc#L81 and maybe that would help...
I wonder if this is related to https://github.com/JuliaLang/julia/issues/57333 which was closed after being fixed in https://github.com/JuliaLang/julia/pull/57392 on Julia 1.12. Perhaps a backport be needed on Julia 1.11
Grasping a straws I just looked at this, but #57392 fixes a bug introduced in #52935 which is only part of the 1.12 release.
Maybe we could use https://github.com/sickcodes/Docker-OSX and limit the RAM available to the VM?
It sounds like #58475 is easier to reproduce locally which is good. I am really hoping that the eventual fix applies to both issues.
More stack traces. This one was a bit different. https://github.com/MilesCranmer/PySR/actions/runs/15207760589/job/42774726916
This one was also macos-latest, Python 3.13, starting julia via juliacall. Similar to @mkitti's #58475, this happened at import time, before any work had been done.
jl_object_id__cold at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/builtins.c:441
smallintset_rehash at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/smallintset.c:218
jl_smallintset_insert at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/smallintset.c:197
jl_idset_put_idx at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/./idset.c:104
jl_as_global_root at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/staticdata.c:2548
jl_root_new_gvars at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/staticdata.c:2283 [inlined]
jl_restore_system_image_from_stream_ at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/staticdata.c:3532
jl_restore_package_image_from_stream at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/staticdata.c:3670
jl_restore_incremental_from_buf at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/staticdata.c:3725 [inlined]
ijl_restore_package_image_from_file at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/staticdata.c:3816
#_include_from_serialized#1082 at ./loading.jl:1245
_include_from_serialized at ./loading.jl:1210 [inlined]
_include_from_serialized at ./loading.jl:1210 [inlined]
#_require_search_from_serialized#1105 at ./loading.jl:2041
_require_search_from_serialized at ./loading.jl:1969
jfptr__require_search_from_serialized_44948.1 at /Users/runner/miniconda3/envs/pysr-test/julia_env/pyjuliapkg/install/lib/julia/sys.dylib (unknown line)
_require at ./loading.jl:2527
__require_prelocked at ./loading.jl:2388
jfptr___require_prelocked_71470.1 at /Users/runner/miniconda3/envs/pysr-test/julia_env/pyjuliapkg/install/lib/julia/sys.dylib (unknown line)
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/./julia.h:2157 [inlined]
jl_f__call_in_world at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/builtins.c:894
#invoke_in_world#3 at ./essentials.jl:1089 [inlined]
invoke_in_world at ./essentials.jl:1086 [inlined]
_require_prelocked at ./loading.jl:2375
macro expansion at ./loading.jl:2314 [inlined]
macro expansion at ./lock.jl:273 [inlined]
__require at ./loading.jl:2271
jfptr___require_71401.1 at /Users/runner/miniconda3/envs/pysr-test/julia_env/pyjuliapkg/install/lib/julia/sys.dylib (unknown line)
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/./julia.h:2157 [inlined]
jl_f__call_in_world at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/builtins.c:894
#invoke_in_world#3 at ./essentials.jl:1089 [inlined]
invoke_in_world at ./essentials.jl:1086 [inlined]
require at ./loading.jl:2260
jfptr_require_71398.1 at /Users/runner/miniconda3/envs/pysr-test/julia_env/pyjuliapkg/install/lib/julia/sys.dylib (unknown line)
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/./julia.h:2157 [inlined]
call_require at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:486 [inlined]
eval_import_path at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:523
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:759
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:886
ijl_toplevel_eval at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:952 [inlined]
ijl_toplevel_eval_in at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-HL2F7YQ3XH.0/build/default-honeycrisp-HL2F7YQ3XH-0/julialang/julia-release-1-dot-11/src/toplevel.c:994
eval at ./boot.jl:430 [inlined]
eval at ./Base.jl:130 [inlined]
pyjlmodule_seval at /Users/runner/.julia/packages/PythonCall/WMWY0/src/JlWrap/module.jl:13
unknown function (ip: 0x10e07413f)
_pyjl_callmethod at /Users/runner/.julia/packages/PythonCall/WMWY0/src/JlWrap/base.jl:67
_pyjl_callmethod at /Users/runner/.julia/packages/PythonCall/WMWY0/src/JlWrap/C.jl:63
jfptr__pyjl_callmethod_9723 at /Users/runner/.julia/compiled/v1.11/PythonCall/WdXsa_sCkpY.dylib (unknown line)
jlcapi__pyjl_callmethod_9817 at /Users/runner/.julia/compiled/v1.11/PythonCall/WdXsa_sCkpY.dylib (unknown line)
cfunction_call at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyObject_MakeTpCall at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyEval_EvalCode at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
builtin_exec at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
cfunction_vectorcall_FASTCALL_KEYWORDS at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
object_vacall at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyObject_CallMethodObjArgs at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyImport_ImportModuleLevelObject at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyEval_EvalCode at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
builtin_exec at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
cfunction_vectorcall_FASTCALL_KEYWORDS at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
object_vacall at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyObject_CallMethodObjArgs at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyImport_ImportModuleLevelObject at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyEval_EvalFrameDefault at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
PyEval_EvalCode at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
run_eval_code_obj at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
run_mod at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
_PyRun_SimpleStringFlagsWithName at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
Py_RunMain at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
pymain_main at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
main at /Users/runner/miniconda3/envs/pysr-test/bin/python3.13 (unknown line)
Allocations: 3897346 (Pool: 3897149; Big: 197); GC: 5
/Users/runner/work/_temp/6c9b3b29-7b61-4662-80f8-7ce7deb28ed6.sh: line 2: 2939 Segmentation fault: 11 python -c "import pysr"
My hypothesis is that this is a lost GC root issue, likely from Python keeping a Julia reference longer that it should and this materializes as a memory corruption.
I don't think so 🤞 - the way Python "owns" Julia objects is that there is a global array of them in PythonCall (so actually owned by Julia) and Python accesses them by index. No pointers or objref shenanigans.
P.S., I just saw this error on windows-latest too. So doesn't seem to be only macOS. It's never shown up on linux though. (Darn linux! Has the best dev tools, but the OS is so well put together you never see the error in the first place...)
Stack trace (click me):
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffebc51d23f -- jl_object_id__cold at C:/workdir/src\builtins.c:455
in expression starting at none:0
jl_object_id__cold at C:/workdir/src\builtins.c:455
ijl_object_id_ at C:/workdir/src\builtins.c:472 [inlined]
ijl_object_id_ at C:/workdir/src\builtins.c:460 [inlined]
jl_table_assign_bp at C:/workdir/src\iddict.c:47 [inlined]
ijl_idtable_rehash at C:/workdir/src\iddict.c:25
jl_table_assign_bp at C:/workdir/src\iddict.c:101 [inlined]
ijl_eqtable_put at C:/workdir/src\iddict.c:146
jl_as_global_root at C:/workdir/src\staticdata.c:2340
emit_expr at C:/workdir/src\codegen.cpp:5461
emit_intrinsic at C:/workdir/src\intrinsics.cpp:1250 [inlined]
emit_call at C:/workdir/src\codegen.cpp:4573
emit_expr at C:/workdir/src\codegen.cpp:5511
emit_ssaval_assign at C:/workdir/src\codegen.cpp:5101
emit_stmtpos at C:/workdir/src\codegen.cpp:5335 [inlined]
emit_function at C:/workdir/src\codegen.cpp:8381
jl_emit_code at C:/workdir/src\codegen.cpp:8716
jl_emit_codeinst at C:/workdir/src\codegen.cpp:8790
jl_compile_workqueue at C:/workdir/src\codegen.cpp:8914
_jl_compile_codeinst at C:/workdir/src\jitlayers.cpp:226
jl_generate_fptr_impl at C:/workdir/src\jitlayers.cpp:520
jl_compile_method_internal at C:/workdir/src\gf.c:2481
jl_compile_method_internal at C:/workdir/src\gf.c:2372 [inlined]
_jl_invoke at C:/workdir/src\gf.c:2887 [inlined]
ijl_apply_generic at C:/workdir/src\gf.c:3077
_pyjl_callmethod at C:\Users\runneradmin\.julia\packages\PythonCall\WMWY0\src\JlWrap\base.jl:67
_pyjl_callmethod at C:\Users\runneradmin\.julia\packages\PythonCall\WMWY0\src\JlWrap\C.jl:63
jfptr__pyjl_callmethod_8959 at C:\Users\runneradmin\.julia\compiled\v1.10\PythonCall\WdXsa_y3YYf.dll (unknown line)
jlcapi__pyjl_callmethod_9043 at C:\Users\runneradmin\.julia\compiled\v1.10\PythonCall\WdXsa_y3YYf.dll (unknown line)
PyCFunction_GetFlags at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_MakeTpCall at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_Vectorcall at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_CallOneArg at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyBytes_Repeat at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyStaticType_InitForExtension at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyStaticType_InitForExtension at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_GetAttr at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalCode at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyErr_WarnExplicitFormat at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyErr_WarnExplicitFormat at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyCFunction_GetFlags at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_Vectorcall at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_CallOneArg at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyBytes_Repeat at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_CallMethodObjArgs at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyImport_ImportModuleNoBlock at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyImport_ImportModuleLevelObject at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_SliceIndexNotNone at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalCode at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyErr_WarnExplicitFormat at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyErr_WarnExplicitFormat at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyCFunction_GetFlags at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_Vectorcall at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_CallOneArg at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyBytes_Repeat at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyObject_CallMethodObjArgs at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyImport_ImportModuleNoBlock at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyImport_ImportModuleLevelObject at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_SliceIndexNotNone at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalFrameDefault at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyEval_EvalCode at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyRun_FileExFlags at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyRun_FileExFlags at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyErr_DisplayException at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
PyRun_SimpleFileExFlags at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
Py_GetBuildInfo at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
Py_RunMain at C:\Users\runneradmin\miniconda3\envs\pysr-test\python313.dll (unknown line)
OPENSSL_Applink at C:\Users\runneradmin\miniconda3\envs\pysr-test\python.exe (unknown line)
BaseThreadInitThunk at C:\Windows\System32\KERNEL32.DLL (unknown line)
RtlUserThreadStart at C:\Windows\SYSTEM32\ntdll.dll (unknown line)
Allocations: 1859241 (Pool: 1857233; Big: [2008](https://github.com/MilesCranmer/PySR/actions/runs/15236738652/job/42851614402#step:3:2009)); GC: 3
From https://github.com/MilesCranmer/PySR/actions/runs/15236738652/job/42851614402
Why do some of the package versions seem older than I would expect?
Which and where?
Isn't the latest version of pyjuliacall 0.9.25? https://github.com/JuliaPy/PythonCall.jl/releases/tag/v0.9.25
I guess one of us needs to sort out the feedstock: https://github.com/conda-forge/pyjuliacall-feedstock/pull/17/checks?check_run_id=42245995309
(Fixed the feedstock, though I doubt it will change this)
Indeed, I am still seeing the issue with the pyjuliacall update: https://github.com/MilesCranmer/PySR/actions/runs/15321443060/job/43105949660
@vchuravy I was finally able to get this on Linux! Check it out: https://github.com/MilesCranmer/PySR/actions/runs/15389485504/job/43295487252 (backup)
Stack trace (click to expand)
2025-06-02T10:07:28.3617099Z #18 107.3 [7] signal (11.1): Segmentation fault
2025-06-02T10:07:28.3617516Z #18 107.3 in expression starting at none:1
2025-06-02T10:07:28.5697104Z #18 107.4 jl_object_id__cold at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/builtins.c:455
2025-06-02T10:07:28.5698963Z #18 107.4 ijl_object_id_ at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/builtins.c:472 [inlined]
2025-06-02T10:07:28.5700082Z #18 107.4 ijl_object_id_ at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/builtins.c:460 [inlined]
2025-06-02T10:07:28.5701198Z #18 107.4 jl_table_assign_bp at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/iddict.c:47 [inlined]
2025-06-02T10:07:28.5702266Z #18 107.4 ijl_idtable_rehash at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/iddict.c:25
2025-06-02T10:07:28.5703358Z #18 107.4 jl_table_assign_bp at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/iddict.c:101 [inlined]
2025-06-02T10:07:28.5705011Z #18 107.4 ijl_eqtable_put at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/iddict.c:146
2025-06-02T10:07:28.5706138Z #18 107.4 jl_as_global_root at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/staticdata.c:2345
2025-06-02T10:07:28.5707318Z #18 107.4 jl_root_new_gvars at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/staticdata.c:2115 [inlined]
2025-06-02T10:07:28.5708629Z #18 107.4 jl_restore_system_image_from_stream_ at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/staticdata.c:3313
2025-06-02T10:07:28.5709966Z #18 107.4 jl_restore_package_image_from_stream at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/staticdata.c:3447
2025-06-02T10:07:28.5711287Z #18 107.4 jl_restore_incremental_from_buf at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/staticdata.c:3494
2025-06-02T10:07:28.5712598Z #18 107.4 ijl_restore_package_image_from_file at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/staticdata.c:3578
2025-06-02T10:07:28.5713538Z #18 107.4 _include_from_serialized at ./loading.jl:1117
2025-06-02T10:07:28.5714072Z #18 107.4 _tryrequire_from_serialized at ./loading.jl:1551
2025-06-02T10:07:28.5715027Z #18 107.4 _require_search_from_serialized at ./loading.jl:1644
2025-06-02T10:07:28.5715552Z #18 107.4 _require at ./loading.jl:2008
2025-06-02T10:07:28.5716010Z #18 107.4 __require_prelocked at ./loading.jl:1882
2025-06-02T10:07:28.5716742Z #18 107.6 jfptr___require_prelocked_81037.1 at /usr/local/julia/lib/julia/sys.so (unknown line)
2025-06-02T10:07:28.7320316Z #18 107.6 _jl_invoke at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
2025-06-02T10:07:28.7321952Z #18 107.6 ijl_apply_generic at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:3077
2025-06-02T10:07:28.7323226Z #18 107.6 jl_apply at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
2025-06-02T10:07:28.7324203Z #18 107.6 jl_f__call_in_world at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/builtins.c:831
2025-06-02T10:07:28.7325040Z #18 107.6 #invoke_in_world#3 at ./essentials.jl:926 [inlined]
2025-06-02T10:07:28.7325404Z #18 107.6 invoke_in_world at ./essentials.jl:923 [inlined]
2025-06-02T10:07:28.7325726Z #18 107.6 _require_prelocked at ./loading.jl:1873
2025-06-02T10:07:28.7326039Z #18 107.6 macro expansion at ./loading.jl:1860 [inlined]
2025-06-02T10:07:28.7326352Z #18 107.6 macro expansion at ./lock.jl:267 [inlined]
2025-06-02T10:07:28.7326629Z #18 107.6 __require at ./loading.jl:1823
2025-06-02T10:07:28.7326991Z #18 107.6 jfptr___require_81000.1 at /usr/local/julia/lib/julia/sys.so (unknown line)
2025-06-02T10:07:28.7327562Z #18 107.6 _jl_invoke at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
2025-06-02T10:07:28.7328218Z #18 107.6 ijl_apply_generic at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:3077
2025-06-02T10:07:28.7328875Z #18 107.6 jl_apply at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
2025-06-02T10:07:28.7329534Z #18 107.6 jl_f__call_in_world at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/builtins.c:831
2025-06-02T10:07:28.7330044Z #18 107.6 #invoke_in_world#3 at ./essentials.jl:926 [inlined]
2025-06-02T10:07:28.7330374Z #18 107.6 invoke_in_world at ./essentials.jl:923 [inlined]
2025-06-02T10:07:28.7330666Z #18 107.6 require at ./loading.jl:1816
2025-06-02T10:07:28.7331015Z #18 107.6 jfptr_require_80997.1 at /usr/local/julia/lib/julia/sys.so (unknown line)
2025-06-02T10:07:28.7331583Z #18 107.6 _jl_invoke at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
2025-06-02T10:07:28.7332262Z #18 107.6 ijl_apply_generic at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:3077
2025-06-02T10:07:28.7332888Z #18 107.6 jl_apply at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
2025-06-02T10:07:28.7333880Z #18 107.6 call_require at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/toplevel.c:481 [inlined]
2025-06-02T10:07:28.7334681Z #18 107.6 eval_import_path at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/toplevel.c:518
2025-06-02T10:07:28.7335339Z #18 107.6 jl_toplevel_eval_flex at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/toplevel.c:752
2025-06-02T10:07:28.7335990Z #18 107.6 jl_toplevel_eval_flex at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/toplevel.c:877
2025-06-02T10:07:28.7336632Z #18 107.6 ijl_toplevel_eval_in at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/toplevel.c:985
2025-06-02T10:07:28.7337083Z #18 107.6 eval at ./boot.jl:385 [inlined]
2025-06-02T10:07:28.7337325Z #18 107.6 eval at ./Base.jl:88 [inlined]
2025-06-02T10:07:28.7337717Z #18 107.6 pyjlmodule_seval at /root/.julia/packages/PythonCall/L4cjh/src/JlWrap/module.jl:13
2025-06-02T10:07:28.7338147Z #18 107.6 unknown function (ip: 0x7f922150982b)
2025-06-02T10:07:28.7338616Z #18 107.6 _jl_invoke at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
2025-06-02T10:07:28.7339414Z #18 107.6 ijl_apply_generic at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:3077
2025-06-02T10:07:28.7339980Z #18 107.6 _pyjl_callmethod at /root/.julia/packages/PythonCall/L4cjh/src/JlWrap/base.jl:67
2025-06-02T10:07:28.7340474Z #18 107.6 _pyjl_callmethod at /root/.julia/packages/PythonCall/L4cjh/src/JlWrap/C.jl:63
2025-06-02T10:07:28.7341031Z #18 107.6 jfptr__pyjl_callmethod_8920 at /root/.julia/compiled/v1.10/PythonCall/WdXsa_QZKPM.so (unknown line)
2025-06-02T10:07:28.7341652Z #18 107.6 _jl_invoke at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:2895 [inlined]
2025-06-02T10:07:28.7342274Z #18 107.6 ijl_apply_generic at /cache/build/builder-amdci5-6/julialang/julia-release-1-dot-10/src/gf.c:3077
2025-06-02T10:07:28.7342878Z #18 107.6 jlcapi__pyjl_callmethod_9005 at /root/.julia/compiled/v1.10/PythonCall/WdXsa_QZKPM.so (unknown line)
2025-06-02T10:07:28.7343384Z #18 107.7 cfunction_call at /usr/src/python/Objects/methodobject.c:551
2025-06-02T10:07:28.9186002Z #18 107.7 _PyObject_MakeTpCall at /usr/src/python/Objects/call.c:242
2025-06-02T10:07:28.9186766Z #18 107.7 _PyEval_EvalFrameDefault at /usr/src/python/Python/generated_cases.c.h:813
2025-06-02T10:07:28.9187471Z #18 107.7 PyEval_EvalCode at /usr/src/python/Python/ceval.c:604
2025-06-02T10:07:28.9188122Z #18 107.7 builtin_exec_impl at /usr/src/python/Python/bltinmodule.c:1143 [inlined]
2025-06-02T10:07:28.9188833Z #18 107.7 builtin_exec at /usr/src/python/Python/clinic/bltinmodule.c.h:556
2025-06-02T10:07:28.9189610Z #18 107.7 cfunction_vectorcall_FASTCALL_KEYWORDS at /usr/src/python/Objects/methodobject.c:441
2025-06-02T10:07:28.9190357Z #18 107.7 PyObject_Call at /usr/src/python/Objects/call.c:373 [inlined]
2025-06-02T10:07:28.9190993Z #18 107.7 PyCFunction_Call at /usr/src/python/Objects/call.c:381 [inlined]
2025-06-02T10:07:28.9191750Z #18 107.7 _PyEval_EvalFrameDefault at /usr/src/python/Python/generated_cases.c.h:1355
2025-06-02T10:07:28.9192622Z #18 107.7 _PyObject_VectorcallTstate at /usr/src/python/./Include/internal/pycore_call.h:168 [inlined]
2025-06-02T10:07:28.9193406Z #18 107.7 object_vacall at /usr/src/python/Objects/call.c:819
2025-06-02T10:07:28.9215771Z #18 107.7 PyObject_CallMethodObjArgs at /usr/src/python/Objects/call.c:880
2025-06-02T10:07:28.9216557Z #18 107.7 import_find_and_load at /usr/src/python/Python/import.c:3704 [inlined]
2025-06-02T10:07:28.9217330Z #18 107.7 PyImport_ImportModuleLevelObject at /usr/src/python/Python/import.c:3786
2025-06-02T10:07:28.9218054Z #18 107.7 import_name at /usr/src/python/Python/ceval.c:2731 [inlined]
2025-06-02T10:07:28.9218755Z #18 107.7 _PyEval_EvalFrameDefault at /usr/src/python/Python/generated_cases.c.h:3205
2025-06-02T10:07:28.9219428Z #18 107.7 PyEval_EvalCode at /usr/src/python/Python/ceval.c:604
2025-06-02T10:07:28.9220336Z #18 107.7 builtin_exec_impl at /usr/src/python/Python/bltinmodule.c:1143 [inlined]
2025-06-02T10:07:28.9221054Z #18 107.7 builtin_exec at /usr/src/python/Python/clinic/bltinmodule.c.h:556
2025-06-02T10:07:28.9221840Z #18 107.7 cfunction_vectorcall_FASTCALL_KEYWORDS at /usr/src/python/Objects/methodobject.c:441
2025-06-02T10:07:28.9222617Z #18 107.7 PyObject_Call at /usr/src/python/Objects/call.c:373 [inlined]
2025-06-02T10:07:28.9223257Z #18 107.7 PyCFunction_Call at /usr/src/python/Objects/call.c:381 [inlined]
2025-06-02T10:07:28.9223981Z #18 107.7 _PyEval_EvalFrameDefault at /usr/src/python/Python/generated_cases.c.h:1355
2025-06-02T10:07:28.9224996Z #18 107.7 _PyObject_VectorcallTstate at /usr/src/python/./Include/internal/pycore_call.h:168 [inlined]
2025-06-02T10:07:28.9225746Z #18 107.7 object_vacall at /usr/src/python/Objects/call.c:819
2025-06-02T10:07:28.9226357Z #18 107.7 PyObject_CallMethodObjArgs at /usr/src/python/Objects/call.c:880
2025-06-02T10:07:28.9227061Z #18 107.7 import_find_and_load at /usr/src/python/Python/import.c:3704 [inlined]
2025-06-02T10:07:28.9227822Z #18 107.7 PyImport_ImportModuleLevelObject at /usr/src/python/Python/import.c:3786
2025-06-02T10:07:28.9228745Z #18 107.7 import_name at /usr/src/python/Python/ceval.c:2731 [inlined]
2025-06-02T10:07:28.9229452Z #18 107.7 _PyEval_EvalFrameDefault at /usr/src/python/Python/generated_cases.c.h:3205
2025-06-02T10:07:28.9230131Z #18 107.7 PyEval_EvalCode at /usr/src/python/Python/ceval.c:604
2025-06-02T10:07:28.9230725Z #18 107.7 run_eval_code_obj at /usr/src/python/Python/pythonrun.c:1381
2025-06-02T10:07:28.9231283Z #18 107.7 run_mod at /usr/src/python/Python/pythonrun.c:1466
2025-06-02T10:07:28.9231910Z #18 107.8 _PyRun_StringFlagsWithName at /usr/src/python/Python/pythonrun.c:1261
2025-06-02T10:07:28.9232682Z #18 107.8 _PyRun_SimpleStringFlagsWithName at /usr/src/python/Python/pythonrun.c:574
2025-06-02T10:07:28.9233413Z #18 107.8 pymain_run_command at /usr/src/python/Modules/main.c:253 [inlined]
2025-06-02T10:07:28.9234080Z #18 107.8 pymain_run_python at /usr/src/python/Modules/main.c:687 [inlined]
2025-06-02T10:07:28.9234803Z #18 107.8 Py_RunMain at /usr/src/python/Modules/main.c:775
2025-06-02T10:07:28.9235323Z #18 107.8 Py_BytesMain at /usr/src/python/Modules/main.c:829
2025-06-02T10:07:28.9235931Z #18 107.8 __libc_start_main at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
2025-06-02T10:07:28.9236465Z #18 107.8 _start at python3 (unknown line)
2025-06-02T10:07:28.9236940Z #18 107.8 Allocations: 1854716 (Pool: 1852705; Big: 2011); GC: 2
2025-06-02T10:07:31.7897812Z #18 110.8 Segmentation fault (core dumped)
2025-06-02T10:07:31.8732165Z #18 ERROR: process "/bin/sh -c python3 -c 'import pysr; pysr.load_all_packages()'" did not complete successfully: exit code: 139
2025-06-02T10:07:31.8734091Z ------
This was seen inside the docker container tests, during the stage it installs some Julia packages via juliacall. It actually seems fairly reproducible, look at all the segfaults: https://github.com/MilesCranmer/PySR/actions/workflows/CI_docker_large_nightly.yml. Happens on both 1.10 and 1.11.
Does that help you to repro it? You should be able to generate it from this: https://github.com/MilesCranmer/PySR?tab=readme-ov-file#docker-1 inside the PySR repo:
docker build -t pysr --build-arg JLVERSION=1.11.5 --build-arg PYVERSION=3.13.3 .
Perhaps you can modify this line: https://github.com/MilesCranmer/PySR/blob/a23b847383ddaa978b2c87c5d0fd78c758f5ff23/Dockerfile#L29 to start things up in Valgrind or whatever you usually use? You can probably reduce it to just python -c "import juliacall".
Because it seems to only pop up in Linux when running in docker, I suppose it's due to the very small memory available, which causes the GC to work in overtime.
I guess someone needs to run this with RR.
PythonCall.jl has a dedicated reproducer for this here: https://github.com/JuliaPy/PythonCall.jl/blob/8b8ac73a24d08110d90c5410c35546522f4e1b52/pytest/test_all.py#L94
@vchuravy any other ideas?
I think you meant run
docker build -t pysr --build-arg JLVERSION=1.11.5 --build-arg PYVERSION=3.13.3 .
in a clone of https://github.com/MilesCranmer/PySR (you forgot the . in the docker build).
Thanks; fixed
@vchuravy any more ideas on this? Still very much broken unfortunately...
This is going to have a catastrophic effect on PySR as well as any other package that connects to Julia via PythonCall.jl. Therefore I am very eager to see this fixed. Can someone advise me on what I can do? Is there a way we can get this issue prioritised?
@adienes we only see the bug on macOS and Windows. rr is only available on Linux.
@adienes we only see the bug on macOS and Windows. rr is only available on Linux.
You reproduced it on Linux here no? https://github.com/JuliaLang/julia/issues/58171#issuecomment-2931546498
I've lost the thread a bit. Do we have any reproducers that run locally (not in CI)?