Skip to content

Segfault on exit when running julia with multithread #49

Open
@eric-cyp24

Description

@eric-cyp24

So the problem started in julia version 1.11
Things works fine without using julia multithread (-t1).
But the PythonPlot.jl package always crashes (Segmentation fault) when exiting, while running on julia multithread (-t2 or higher).
Even when a simple import and exit, it still shows segmentation fault on exit:

user@mycomputer:~$ julia -t1 -e 'import PythonPlot'
user@mycomputer:~$ julia -t2 -e 'import PythonPlot'

[2508368] signal 11 (1): Segmentation fault
in expression starting at none:0
PyObject_RichCompare at /usr/lib/x86_64-linux-gnu/libpython3.8.so.1.0 (unknown line)
PyObject_RichCompare at /local/scratch/user/julia-depot/packages/PythonCall/WMWY0/src/C/pointers.jl:303 [inlined]
macro expansion at /local/scratch/user/julia-depot/packages/PythonCall/WMWY0/src/Core/Py.jl:132 [inlined]
pyne at /local/scratch/user/julia-depot/packages/PythonCall/WMWY0/src/Core/builtins.jl:266
!= at /local/scratch/user/julia-depot/packages/PythonCall/WMWY0/src/Core/Py.jl:361 [inlined]
#9 at /local/scratch/user/julia-depot/packages/PythonPlot/469aA/src/pygui.jl:199
#816 at ./asyncevent.jl:313
unknown function (ip: 0x7fa6873a962f)
jl_apply at /cache/build/builder-demeter6-3/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
start_task at /cache/build/builder-demeter6-3/julialang/julia-release-1-dot-11/src/task.c:1202
Allocations: 3869967 (Pool: 3869760; Big: 207); GC: 5
Segmentation fault

Environment

user@mycomputer:~$ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.3 (2025-01-21)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> versioninfo()
Julia Version 1.11.3
Commit d63adeda50d (2025-01-21 19:42 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 8 ? Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, skylake)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_PYTHONCALL_EXE = /usr/bin/python3
  JULIA_DEPOT_PATH = /local/scratch/user/julia-depot:/local/scratch/user/julia-depot:
  JULIA_PKG_DEVDIR = /home/user/.julia/dev

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions