[issue45758] Crash on Py_DecRef'ing builtin object from previous run

2021-11-12 Thread Victor Milovanov
Victor Milovanov added the comment: I think documentation should clarify that. Right now this line in the docs got me thinking that anything with an external strong reference won't be deallocated: "Memory tied up in circular references between objects is not freed." -- status:

[issue45758] Crash on Py_DecRef'ing builtin object from previous run

2021-11-12 Thread Ronald Oussoren
Ronald Oussoren added the comment: IMHO your code is buggy, as Hai Shi also indicates. After Py_Finalize all objects in all (sub-)interpreters are deallocated unless there are bugs in the interpreter. Because of this "..., item should still be alive" in your sample code is incorrect: the

[issue45758] Crash on Py_DecRef'ing builtin object from previous run

2021-11-09 Thread Hai Shi
Hai Shi added the comment: Hi, Victor Milovanov. The memory allocated by interpreter will be freed after calling Py_Finalize(). -- nosy: +pablogsal, shihai1991 ___ Python tracker

[issue45758] Crash on Py_DecRef'ing builtin object from previous run

2021-11-08 Thread Victor Milovanov
New submission from Victor Milovanov : Trying to Py_DecRef owned reference to builtin "iter" crashes if the reference was alive when runtime was reinitialized. Py_Initialize(); PyObject* builtins = PyEval_GetBuiltins(); PyObject* iter = PyDict_GetItemString(builtins, "iter");