Commit 8bfef30 exposed a reference counting error, causing the interpreter to crash before exiting. The solution is to incref the exception type before calling PyErr_Restore.
Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -163,7 +163,10 @@ Py_filter_set_c_weighting (Py_filter * self, PyObject *args) · 162 unmodified lines | |||
| 163 | // change the RuntimeError into ValueError | 163 | // change the RuntimeError into ValueError |
| 164 | PyObject *type, *value, *traceback; | 164 | PyObject *type, *value, *traceback; |
| 165 | PyErr_Fetch(&type, &value, &traceback); | 165 | PyErr_Fetch(&type, &value, &traceback); |
| 166 | PyErr_Restore(PyExc_ValueError, value, traceback); | 166 | Py_XDECREF(type); |
| 167 | type = PyExc_ValueError; | ||
| 168 | Py_XINCREF(type); | ||
| 169 | PyErr_Restore(type, value, traceback); | ||
| 167 | } | 170 | } |
| 168 | return NULL; | 171 | return NULL; |
| 169 | } | 172 | } |
| @@ -188,7 +191,10 @@ Py_filter_set_a_weighting (Py_filter * self, PyObject *args) · 18 unmodified lines | |||
| 188 | // change the RuntimeError into ValueError | 191 | // change the RuntimeError into ValueError |
| 189 | PyObject *type, *value, *traceback; | 192 | PyObject *type, *value, *traceback; |
| 190 | PyErr_Fetch(&type, &value, &traceback); | 193 | PyErr_Fetch(&type, &value, &traceback); |
| 191 | PyErr_Restore(PyExc_ValueError, value, traceback); | 194 | Py_XDECREF(type); |
| 195 | type = PyExc_ValueError; | ||
| 196 | Py_XINCREF(type); | ||
| 197 | PyErr_Restore(type, value, traceback); | ||
| 192 | } | 198 | } |
| 193 | return NULL; | 199 | return NULL; |
| 194 | } | 200 | } |
| @@ -213,7 +219,10 @@ Py_filter_set_biquad(Py_filter * self, PyObject *args) · 18 unmodified lines | |||
| 213 | // change the RuntimeError into ValueError | 219 | // change the RuntimeError into ValueError |
| 214 | PyObject *type, *value, *traceback; | 220 | PyObject *type, *value, *traceback; |
| 215 | PyErr_Fetch(&type, &value, &traceback); | 221 | PyErr_Fetch(&type, &value, &traceback); |
| 216 | PyErr_Restore(PyExc_ValueError, value, traceback); | 222 | Py_XDECREF(type); |
| 223 | type = PyExc_ValueError; | ||
| 224 | Py_XINCREF(type); | ||
| 225 | PyErr_Restore(type, value, traceback); | ||
| 217 | } | 226 | } |
| 218 | return NULL; | 227 | return NULL; |
| 219 | } | 228 | } |