Message369461
> Is this a separate bug? So maybe the issue is that the new code is letting things get into this state. Some of my changes added new chaining in various places, so that would fit (but still investigating).
Looks like there isn't a recursion guard on https://github.com/python/cpython/blob/e572c7f6dbe5397153803eab256e4a4ca3384f80/Python/errors.c#L143-L154
I'm not sure if this would be the real solution but, for this case, it works
diff --git a/Python/errors.c b/Python/errors.c
index 3b42c1120b..ba3df483e2 100644
--- a/Python/errors.c
+++ b/Python/errors.c
@@ -141,8 +141,8 @@ _PyErr_SetObject(PyThreadState *tstate, PyObject *exception, PyObject *value)
usually very short. Sensitive readers may try
to inline the call to PyException_GetContext. */
if (exc_value != value) {
- PyObject *o = exc_value, *context;
- while ((context = PyException_GetContext(o))) {
+ PyObject *o = exc_value, *context = NULL;
+ while (o != context && (context = PyException_GetContext(o))) {
Py_DECREF(context);
if (context == value) {
PyException_SetContext(o, NULL);
(END) |
|
Date |
User |
Action |
Args |
2020-05-20 15:06:56 | BTaskaya | set | recipients:
+ BTaskaya, asvetlov, chris.jerdonek, yselivanov, eamanu, aeros, carltongibson, felixxm |
2020-05-20 15:06:56 | BTaskaya | set | messageid: <1589987216.36.0.97335916354.issue40696@roundup.psfhosted.org> |
2020-05-20 15:06:56 | BTaskaya | link | issue40696 messages |
2020-05-20 15:06:56 | BTaskaya | create | |
|