Closed as not planned
Description
Bug report
Bug description:
Short untested example:
lst = ... # a numpy darray
res = func(lst.tolist()) # function in the C extension. edits in-place lst.tolist() -> returns a List. res depends on `lst`
print(res[0]) # Segmentation fault when accessing res in some way
func
edits lst.tolist()
in-place, and res
depends on lst.tolist()
, possibly res is lst.tolist()
.
We get a segfault when printing. It results of a GC collection error, probably because lst.tolist()
is invalidly being freed. Assigning lst.tolist()
to a variable fixes the segfault.
It might be Python intent to act like this.
CPython versions tested on:
3.9
Operating systems tested on:
Linux