Bug report
In #127524, @mpage suggested adding an assert to check that the list object is locked when calling ensure_shared_on_resize. This uncovers a few more locking issues.
Additionally, we may return out of the critical section without unlocking here:
| Py_BEGIN_CRITICAL_SECTION(a); |
| Py_ssize_tn=PyList_GET_SIZE(a); |
| PyObject*copy=list_slice_lock_held(a, 0, n); |
| if (copy==NULL) { |
| return-1; |
| } |
| ret=list_ass_slice_lock_held(a, ilow, ihigh, copy); |
| Py_DECREF(copy); |
| Py_END_CRITICAL_SECTION(); |
Linked PRs
Bug report
In #127524, @mpage suggested adding an assert to check that the list object is locked when calling
ensure_shared_on_resize. This uncovers a few more locking issues.Additionally, we may return out of the critical section without unlocking here:
cpython/Objects/listobject.c
Lines 956 to 964 in c7dec02
Linked PRs