[capi-sig]Re: Open questions about borrowed references
4 Sep
2018
4 Sep
'18
3:36 p.m.
On 2018-09-04 23:28, Victor Stinner wrote:
Hi,
Ah! I succeeded to get a dangling pointer to a deallocated type object using Py_TYPE(). The example is designed to trigger the bug, but it proves that it's important to hold a strong reference to the type when using Py_TYPE(). Maybe it's not an issue for the normal case in the wild, but at least my example provides that there is an issue in a corner case which waits to bite you.
What's your point really? It's known that Py_TYPE() returns a borrowed reference, so your example code is buggy. It shouldn't surprise anyone that borrowed references can crash CPython.
2033
Age (days ago)
2033
Last active (days ago)
3 comments
3 participants
participants (3)
-
Antoine Pitrou
-
Jeroen Demeyer
-
Victor Stinner