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
del StopIteration.value stores NULL in C field, crashing generators (SIGSEGV) #159090
del e.value on a StopIteration instance stores NULL into PyStopIterationObject.value. The getter substitutes Py_None so it
looks fine at Python level, but two C consumers dereference it unconditionally.
Root cause — exceptions.c:721 declares value as _Py_T_OBJECT with flags=0, which permits del. Fix: use _Py_T_OBJECT_EX or add Py_READONLY,
or add NULL guards in both consumers.
Found while auditing CPython with a static-analysis toolkit flagging Py_NewRef/Py_XNewRef mismatches.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
Python 3.16.0a0 (heads/main:1a852139408, Oct 3 2026, 10:47:03) [GCC 13.3.0]
Activity