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).
Activity
ZeroIntensity commentedon Aug 12, 2024
As mentioned in the PR, a
NULLcheck doesn't fix dangling pointers.With that being said, calling
_PyThreadState_MustExitwith an invalid thread state sounds like a bug, is there a specific case of this happening?neonene commentedon Aug 13, 2024
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.See also #109794 (comment), #104341 (comment).
picnixz commentedon Aug 14, 2024
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).neonene commentedon Aug 15, 2024
Please change the title, or make the PR belong to gh-109793. The current title is not good for closing here as "completed".
[-]tstate might be a dangling pointer[/-][+]asserting that the tstate pointer is non-NULL using assert[/+]vstinner commentedon Sep 18, 2024
The change is not needed: #122929 (review)