Frame evaluation debugger stops with stack overflow after reloading (PY-23737)

Sometimes during process shutdown Python nullifies some global variables, but still calls frame evaluation function. Add check for avoiding such situations.
This commit is contained in:
Elizaveta Shashkova
2017-04-17 21:20:10 +03:00
parent 91a45bf7ed
commit 6c42293d51
2 changed files with 1066 additions and 1016 deletions
File diff suppressed because it is too large Load Diff
@@ -50,6 +50,10 @@ cdef PyObject* get_bytecode_while_frame_eval(PyFrameObject *frame_obj, int exc):
cdef int* extra_value = NULL
cdef int thread_index = -1
if is_use_code_extra is None or AVOID_RECURSION is None:
# Sometimes during process shutdown these global variables become None
return _PyEval_EvalFrameDefault(frame_obj, exc)
if is_use_code_extra():
extra = PyMem_Malloc(sizeof(int))
try: