-
Notifications
You must be signed in to change notification settings - Fork 78
Open
Labels
bugSomething isn't workingSomething isn't working
Description
using Base.Threads
using PythonCall
o = Py(randn(3,3))
t = Threads.@spawn begin
PythonCall.GIL.@lock begin
println(Core.stderr, propertynames(o))
end
end
PythonCall.GIL.@unlock wait(t)julia +1.12 --project=. mwe.jl
CondaPkg Found dev dependencies: /home/topolarity/repos/claude/PythonCall.jl/CondaPkg.toml
CondaPkg Found dependencies: /home/topolarity/.julia/packages/CondaPkg/8GjrP/CondaPkg.toml
...
[127641] signal 11 (1): Segmentation fault
in expression starting at /home/topolarity/repos/claude/PythonCall.jl/mwe.jl:9
_PyInterpreterState_GET at /usr/local/src/conda/python-3.14.3/Include/internal/pycore_pystate.h:211 [inlined]
get_type_cache at /usr/local/src/conda/python-3.14.3/Objects/typeobject.c:868 [inlined]
_PyType_LookupStackRefAndVersion at /usr/local/src/conda/python-3.14.3/Objects/typeobject.c:5798 [inlined]
_PyType_LookupRefAndVersion at /usr/local/src/conda/python-3.14.3/Objects/typeobject.c:5784 [inlined]
_PyType_LookupRef at /usr/local/src/conda/python-3.14.3/Objects/typeobject.c:5896 [inlined]
_PyObject_LookupSpecial at /usr/local/src/conda/python-3.14.3/Objects/typeobject.c:2791
_dir_object at /usr/local/src/conda/python-3.14.3/Objects/object.c:2020 [inlined]
PyObject_Dir at /usr/local/src/conda/python-3.14.3/Objects/object.c:2052
PyObject_Dir at /home/topolarity/repos/claude/PythonCall.jl/src/C/pointers.jl:302 [inlined]
macro expansion at /home/topolarity/repos/claude/PythonCall.jl/src/Core/Py.jl:118 [inlined]
pydir at /home/topolarity/repos/claude/PythonCall.jl/src/Core/builtins.jl:191
#4 at /home/topolarity/repos/claude/PythonCall.jl/src/Core/Py.jl:297The problem is that #677 assumes the main thread is the appropriate thread to run this on, but that's not true in general if you're using the GIL / doing true multi-threading.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working