Skip to content

Julia crashes (Segmentation fault) when using tab completion with PythonCall #713

Description

@truedichotomy

Affects: PythonCall

Describe the bug
I'm running Julia 1.12.1 on macOS 26.1 and it will completely crash whenever I try to use tab completion on any loaded python library through PythonCall. I have Anaconda installed and tried both python 3.12 and 3.13 with the same result. I know it happens on both macOS 15.7 as well as macOS 26.1.

julia> using PythonCall

julia> sys = pyimport("sys")
Python: <module 'sys' (built-in)>

julia> sys.
[59054] signal 11 (2): Segmentation fault: 11
in expression starting at REPL[5]:1
	_PyObject_LookupSpecial at /opt/anaconda3/envs/ocean/lib/libpython3.12.dylib (unknown line)
PyObject_Dir at /opt/anaconda3/envs/ocean/lib/libpython3.12.dylib (unknown line)
PyObject_Dir at /Users/gong/.julia/packages/PythonCall/mkWc2/src/C/pointers.jl:300 [inlined]
macro expansion at /Users/gong/.julia/packages/PythonCall/mkWc2/src/Core/Py.jl:118 [inlined]
pydir at /Users/gong/.julia/packages/PythonCall/mkWc2/src/Core/builtins.jl:191
propertynames at /Users/gong/.julia/packages/PythonCall/mkWc2/src/Core/Py.jl:270
unknown function (ip: 0x137ae4353) at (unknown file)
#complete_symbol!#6 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:230
complete_symbol! at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:184
unknown function (ip: 0x1379f407f) at (unknown file)
completions at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPLCompletions.jl:1150
#complete_line#66 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:809
complete_line at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:807
unknown function (ip: 0x13773052f) at (unknown file)
#complete_line_named#17 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:401
complete_line_named at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:400 [inlined]
macro expansion at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:442 [inlined]
macro expansion at ./lock.jl:376 [inlined]
#check_show_hint##2 at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/LineEdit.jl:439
jfptr_YY.check_show_hintYY.YY.2_18133.1 at /Users/gong/.julia/juliaup/julia-1.12.1+0.aarch64.apple.darwin14/share/julia/compiled/v1.12/REPL/u0gqU_vMi9E.dylib (unknown line)
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/src/./julia.h:2391 [inlined]
start_task at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-12/src/task.c:1249
Allocations: 74692492 (Pool: 74688757; Big: 3735); GC: 117
zsh: segmentation fault  julia
(base) gong@pluto ~ %   

Your system

julia> versioninfo()
Julia Version 1.12.1
Commit ba1e628ee49 (2025-10-17 13:02 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: macOS (arm64-apple-darwin24.0.0)
  CPU: 16 × Apple M3 Max
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, apple-m3)
  GC: Built with stock GC
Threads: 12 default, 1 interactive, 12 GC (on 12 virtual cores)
Environment:
  JULIA_NUM_THREADS = 12
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_PYTHONCALL_EXE = /opt/anaconda3/envs/ocean/bin/python

Additional context
I posted this issue to Julia's GitHub and it was suggested that this is a PythonCall bug.

Activity

  1. cjdoris commented on Nov 14, 2025

    @cjdoris
    Member

    Ah this was fixed a while ago but is only just released. Update to PythonCall 0.9.29 and it should be fixed.

  2. andreeco commented on Nov 17, 2025

    @andreeco

    I get a similar error. I’m not even using tab completion. The error happens while I’m typing in the REPL. My error message is similar to this one:

    julia> using PythonCall
    
    (@v1.12) pkg> status PythonCall
    Status `~/.julia/environments/v1.12/Project.toml`
      [6099a3de] PythonCall v0.9.29
    
    julia> re = pyimport("re")
    Python: <module 're' from '/home/me/.julia/environments/v1.12/.CondaPkg/.pixi/envs/default/lib/python3.14/re/__init__.py'>
    
    julia> words = re.Fatal Python error: _Py_CheckRecursiveCall: Unrecoverable stack overflow (used 705193 kB) while calling a Python object
    Python runtime state: initialized
    
    Current thread 0x00007fb3b8b31180 [julia] (most recent call first):
      <no Python frame>
    
    [30574] signal 6 (-6): Aborted
    in expression starting at REPL[4]:1
    unknown function (ip: 0x7fb3b8be995c) at /lib/x86_64-linux-gnu/libc.so.6
    gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
    abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
    fatal_error_exit at /usr/local/src/conda/python-3.14.0/Python/pylifecycle.c:3250 [inlined]
    fatal_error at /usr/local/src/conda/python-3.14.0/Python/pylifecycle.c:3396
    _Py_FatalErrorFunc at /usr/local/src/conda/python-3.14.0/Python/pylifecycle.c:3482
    _Py_CheckRecursiveCall at /usr/local/src/conda/python-3.14.0/Python/ceval.c:491
    _Py_EnterRecursiveCallTstate at /usr/local/src/conda/python-3.14.0/Include/internal/pycore_ceval.h:216 [inlined]
    method_enter_call at /usr/local/src/conda/python-3.14.0/Objects/descrobject.c:300 [inlined]
    method_vectorcall_NOARGS at /usr/local/src/conda/python-3.14.0/Objects/descrobject.c:444
    _PyObject_VectorcallTstate at /usr/local/src/conda/python-3.14.0/Include/internal/pycore_call.h:169 [inlined]
    PyObject_VectorcallMethod at /usr/local/src/conda/python-3.14.0/Objects/call.c:856
    PyObject_CallMethodNoArgs at /usr/local/src/conda/python-3.14.0/Include/cpython/abstract.h:65 [inlined]
    _PyFile_Flush at /usr/local/src/conda/python-3.14.0/Objects/fileobject.c:542
    flush_std_files at /usr/local/src/conda/python-3.14.0/Python/pylifecycle.c:1915
    fatal_error at /usr/local/src/conda/python-3.14.0/Python/pylifecycle.c:3459
    _Py_FatalErrorFunc at /usr/local/src/conda/python-3.14.0/Python/pylifecycle.c:3482
    _Py_CheckRecursiveCall at /usr/local/src/conda/python-3.14.0/Python/ceval.c:491
    _Py_EnterRecursiveCallTstate at /usr/local/src/conda/python-3.14.0/Include/internal/pycore_ceval.h:216 [inlined]
    cfunction_enter_call at /usr/local/src/conda/python-3.14.0/Objects/methodobject.c:428 [inlined]
    cfunction_vectorcall_NOARGS at /usr/local/src/conda/python-3.14.0/Objects/methodobject.c:504
    _PyObject_VectorcallTstate at /usr/local/src/conda/python-3.14.0/Include/internal/pycore_call.h:169
    _PyObject_CallNoArgs at /usr/local/src/conda/python-3.14.0/Include/internal/pycore_call.h:185 [inlined]
    _dir_object at /usr/local/src/conda/python-3.14.0/Objects/object.c:2029 [inlined]
    PyObject_Dir at /usr/local/src/conda/python-3.14.0/Objects/object.c:2052
    PyObject_Dir at /home/me/.julia/packages/PythonCall/Ds20G/src/C/pointers.jl:300 [inlined]
    macro expansion at /home/me/.julia/packages/PythonCall/Ds20G/src/Core/Py.jl:118 [inlined]
    pydir at /home/me/.julia/packages/PythonCall/Ds20G/src/Core/builtins.jl:191
    #4 at /home/me/.julia/packages/PythonCall/Ds20G/src/Core/Py.jl:297
    unknown function (ip: 0x7fb386b10b6f) at (unknown file)
    jl_apply at /cache/build/tester-amdci4-14/julialang/julia-release-1-dot-12/src/julia.h:2391 [inlined]
    jl_f_invokelatest at /cache/build/tester-amdci4-14/julialang/julia-release-1-dot-12/src/builtins.c:881
    #setup_onfixedthread##1 at /home/me/.julia/packages/PythonCall/Ds20G/src/C/context.jl:44
    unknown function (ip: 0x7fb39c95b14f) at (unknown file)
    jl_apply at /cache/build/tester-amdci4-14/julialang/julia-release-1-dot-12/src/julia.h:2391 [inlined]
    start_task at /cache/build/tester-amdci4-14/julialang/julia-release-1-dot-12/src/task.c:1249
    Allocations: 31376985 (Pool: 31372074; Big: 4911); GC: 19
    Aborted

    However, if I copy and paste the example from here in one step, it runs without any errors.

  3. cjdoris commented on Nov 17, 2025

    @cjdoris
    Member

    Ah yes what you're seeing is a known issue with Python 3.14. If you use Python 3.13 (e.g. you can do CondaPkg.add("python", version="<3.14")) that error goes away. I need to make a release that excludes Python 3.14 automatically for now.

  4. andreeco commented on Nov 17, 2025

    @andreeco

    Thanks for your fast reply!

  5. cjdoris commented on Nov 18, 2025

    @cjdoris
    Member

    I believe this is resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions