`Segmentation fault(core dumped)` when using multiple threads
- Lingua principale
- Julia
- Stelle
- 1.5k
- Fork
- 186
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
I first make multiple copies of a PyObject, and then access them in multiple threads. Finally, I meet this error.
`julia -t5`
```
using PyCall
py"""
class A():
x = 0.0
a = A()
"""
alist = [deepcopy(py"a") for i in 1:10]
# @show alist
for j in 1:100
Threads.@threads for i in 1:10
alist[i].x
end
end
```
Julia version
```
Julia Version 1.9.3
Commit bed2cd540a1 (2023-08-24 14:43 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Linux (x86_64-linux-gnu)
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, goldmont)
```
Thanks.
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Start by running the Julia 1.9.3 reproduction from the issue with `julia -t5`, focusing on `PyCall` object access from the threaded loop after `deepcopy`. Trace the threading and Python-object handling involved; done means the supplied program no longer segfaults when repeated across multiple threads.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- julia, python
- Ambito
- backend
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100