Issue #14432: Remove the thread state field from the frame structure. Fix a

crash when a generator is created in a C thread that is destroyed while the
generator is still used. The issue was that a generator contains a frame, and
the frame kept a reference to the Python state of the destroyed C thread. The
crash occurs when a trace function is setup.
This commit is contained in:
Victor Stinner 2013-12-13 02:01:38 +01:00
parent 62ca10051b
commit fdeb6ec45a
8 changed files with 179 additions and 45 deletions

View file

@ -39,7 +39,6 @@ typedef struct _frame {
/* Borrowed reference to a generator, or NULL */
PyObject *f_gen;
PyThreadState *f_tstate;
int f_lasti; /* Last instruction if called */
/* Call PyFrame_GetLineNumber() instead of reading this field
directly. As of 2.3 f_lineno is only valid when tracing is