JuliaPy / JuliaPy/PythonCall.jl

`pyhasattr` segfault

Aberta
#282 10 comentários 0 reações 0 responsáveis Ver no GitHub
documentation
Linguagem predominante
Julia
Estrelas
1.1k
Forks
86
Merge médio
1d 22h
PRs com merge (30d)
3

Descrição

I'm getting a segfault with PythonPlot.jl after a testsuite has finished, assuming that it's during finalizers
https://github.com/stevengj/PythonPlot.jl/pull/24

```
signal (11): Segmentation fault
in expression starting at none:0
_PyInterpreterState_GET at /usr/local/src/conda/python-3.11.0/Include/internal/pycore_pystate.h:116 [inlined]
get_dict_state at /usr/local/src/conda/python-3.11.0/Objects/dictobject.c:251 [inlined]
new_dict at /usr/local/src/conda/python-3.11.0/Objects/dictobject.c:722 [inlined]
PyDict_New at /usr/local/src/conda/python-3.11.0/Objects/dictobject.c:841
type_ready_set_dict at /usr/local/src/conda/python-3.11.0/Objects/typeobject.c:6143 [inlined]
type_ready at /usr/local/src/conda/python-3.11.0/Objects/typeobject.c:6462 [inlined]
PyType_Ready at /usr/local/src/conda/python-3.11.0/Objects/typeobject.c:6513
_PyObject_GenericGetAttrWithDict at /usr/local/src/conda/python-3.11.0/Objects/object.c:1266
PyObject_GenericGetAttr at /usr/local/src/conda/python-3.11.0/Objects/object.c:1367 [inlined]
module_getattro at /usr/local/src/conda/python-3.11.0/Objects/moduleobject.c:761
PyObject_GetAttr at /usr/local/src/conda/python-3.11.0/Objects/object.c:916
PyObject_GetAttr at /home/ubuntu/.julia/packages/PythonCall/dsECZ/src/cpython/pointers.jl:299 [inlined]
macro expansion at /home/ubuntu/.julia/packages/PythonCall/dsECZ/src/Py.jl:131 [inlined]
pyhasattr at /home/ubuntu/.julia/packages/PythonCall/dsECZ/src/abstract/object.jl:37
#9 at /home/ubuntu/.julia/packages/PythonPlot/ei8cR/src/pygui.jl:194
macro expansion at ./asyncevent.jl:281 [inlined]
#666 at ./task.jl:134
unknown function (ip: 0x7fac1b57080f)
_jl_invoke at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/gf.c:2377 [inlined]
ijl_apply_generic at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/gf.c:2559
jl_apply at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/julia.h:1843 [inlined]
start_task at /cache/build/default-amdci4-2/julialang/julia-release-1-dot-8/src/task.c:931
Allocations: 860081766 (Pool: 859557939; Big: 523827); GC: 110
```

I noticed that `pyhasattr` is `PyObject_GetAttr` backed.
Perhaps it needs some more protection against whatever is causing this?

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Start with the pyhasattr call in src/abstract/object.jl and trace through src/Py.jl and src/cpython/pointers.jl, using the reported PythonPlot.jl finalizer path in pygui.jl:194 as the reproduction context. Reproduce the post-testsuite segfault and determine the required protection around PyObject_GetAttr; done means the failing scenario no longer crashes and has regression coverage.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
julia, python
Domínio
backend
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Precisa de esclarecimento
Facilidade para iniciantes
25/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.