This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author yselivanov
Recipients kayhayen, pablogsal, pitrou, serhiy.storchaka, vstinner, yselivanov
Date 2018-07-05.19:43:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
This isn't a real reference bug, but rather a bug in total refs accountability.  It seems that I missed the fact that we track refs to the keys table with a DK_INCREF macro.

The new `clone_combined_dict` uses `memcpy` to clone the keys table (along with its `dk_refcnt` field, but it doesn't register the fact that we have a new keys table after copying.  The bug can be solved with the following diff:

diff --git a/Objects/dictobject.c b/Objects/dictobject.c
index 7a1bcebec6..3ac6a54415 100644
--- a/Objects/dictobject.c
+++ b/Objects/dictobject.c
@@ -656,6 +656,7 @@ clone_combined_dict(PyDictObject *orig)
         /* Maintain tracking. */
     return (PyObject *)new;

I don't think this is a critical-level bug that needs an emergency 3.7.1 release, but I'll submit a PR right now. Would appreciate if you guys can review it.
Date User Action Args
2018-07-05 19:43:52yselivanovsetrecipients: + yselivanov, pitrou, vstinner, kayhayen, serhiy.storchaka, pablogsal
2018-07-05 19:43:52yselivanovsetmessageid: <>
2018-07-05 19:43:52yselivanovlinkissue34042 messages
2018-07-05 19:43:52yselivanovcreate