You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
asserting that the tstate pointer is non-NULL using assert #122928
My understanding is that a problematic dangling pointer could be caused by the legacy non-isolated subinterpreter created with Py_NewInterpreter(), allowing daemon threads. Now that Python uses and recommends the new isolated subinterpreter, I do not think the concern is worth much consideration.
I'm wondering whether the issue should still mention dangling pointer since a dangling pointer is a valid pointer (hence non-null) pointing to invalid memory. It's more about asserting that the pointer is non-NULL using assert (namely, enforcing pre-conditions).
Bug report
Bug description:
https://github.com/python/cpython/blob/main/Python/pystate.c#L3016
To prevent dangling pointer issues, adding a check for NULL ensures that invalid pointers are not dereferenced
Linked PRs