JuliaPy / JuliaPy/PythonCall.jl

Segfault in `_jl_call_nogil` with jupyter extension or passing pytypes

Đang mở
#542 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
bug
Ngôn ngữ chính
Julia
Star
1.1k
Fork
86
Merge trung bình
1 ngày 22 giờ
Pull request đã merge (30 ngày)
3

Mô tả

**Affects:** JuliaCall

**Describe the bug**

If I run this in a jupyter notebook

```python
from juliacall import Main as jl
jl.println._jl_call_nogil("foo") # segfaus
```
I get a segfault.

It goes away if I disable the extension:

```python
import os
os.environ["PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION"] = "no"
from juliacall import Main as jl
jl.println._jl_call_nogil("foo") # works
```

Also I get segfaults if I pass a python type that I would expect to be converted, e.g.

```python
import os
os.environ["PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION"] = "no"
from juliacall import Main as jl
jl.println._jl_call_nogil({}) # segfaults
```

This goes away if I manually convert

```python
import os
os.environ["PYTHON_JULIACALL_AUTOLOAD_IPYTHON_EXTENSION"] = "no"
from juliacall import Main as jl
jl.println._jl_call_nogil(jl.pyconvert(jl.Dict, {})) # works
```

**Your system**
- macos 13.6.8, M2
- Julia 1.10.4, with PythonCall 0.9.22

`versioninfo()`
```
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin22.4.0)
CPU: 12 × Apple M2 Pro
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)
Environment:
JULIA_PKG_USE_CLI_GIT = true
JULIA_PYTHONCALL_EXE = /Users/pcrein/.pyenv/versions/3.11.4/envs/test-juliacall/bin/python3.11
```

`Pkg.status()`
```
Status `~/.pyenv/versions/3.11.4/envs/test-juliacall/julia_env/Project.toml`
[6099a3de] PythonCall v0.9.22`
```

`CondaPkg.status()` I don't seem to have condapkg

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.