Skip to content

Commit

Permalink
pythongh-117657: Fix data race in dict_dict_merge (pythongh-129755)
Browse files Browse the repository at this point in the history
Found while running `test_load_attr_module` from `test_opcache` under TSan.
(cherry picked from commit 34379d0)

Co-authored-by: Sam Gross <[email protected]>
  • Loading branch information
colesbury authored and miss-islington committed Feb 7, 2025
1 parent aae0a1f commit 4df3cc8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -3713,7 +3713,7 @@ dict_dict_merge(PyInterpreterState *interp, PyDictObject *mp, PyDictObject *othe

ensure_shared_on_resize(mp);
dictkeys_decref(interp, mp->ma_keys, IS_DICT_SHARED(mp));
mp->ma_keys = keys;
set_keys(mp, keys);
STORE_USED(mp, other->ma_used);
mp->ma_version_tag = new_version;
ASSERT_CONSISTENT(mp);
Expand Down

0 comments on commit 4df3cc8

Please sign in to comment.