| commit | e666a01ef42939f77f4c22ca47a610df5ef8b7ab | [log] [tgz] |
|---|---|---|
| author | Sam Gross <colesbury@gmail.com> | Fri Jan 30 16:14:10 2026 |
| committer | GitHub <noreply@github.com> | Fri Jan 30 16:14:10 2026 |
| tree | d3607eedf3f0ecbde7406b86d8749bc2a7915639 | |
| parent | 1dc12b2883c89045469f3c401157d4df13f535f0 [diff] |
gh-144295: Fix data race in dict method lookup and global load (gh-144312) In `_PyDict_GetMethodStackRef`, only use the fast-path unicode lookup when the dict is owned by the current thread or already marked as shared. This prevents a race between the lookup and concurrent dict resizes, which may free the PyDictKeysObject (i.e., it ensures that the resize uses QSBR). Address a similar issue in `_Py_dict_lookup_threadsafe_stackref` by calling `ensure_shared_on_read()`.