[issue47250] Add object.__getstate__() introduced a refleak

STINNER Victor report at bugs.python.org
Thu Apr 7 10:56:51 EDT 2022


New submission from STINNER Victor <vstinner at python.org>:

The following change introduced reference leaks:
---
commit 884eba3c76916889fd6bff3b37b8552bfb4f9566
Author: Serhiy Storchaka <storchaka at gmail.com>
Date:   Wed Apr 6 20:00:14 2022 +0300

    bpo-26579: Add object.__getstate__(). (GH-2821)
    
    Copying and pickling instances of subclasses of builtin types
    bytearray, set, frozenset, collections.OrderedDict, collections.deque,
    weakref.WeakSet, and datetime.tzinfo now copies and pickles instance attributes
    implemented as slots.
---


Example of buildbot failure.

AMD64 RHEL8 Refleaks 3.x:
https://buildbot.python.org/all/#builders/259/builds/355

14 tests failed:
    test_bytes test_copy test_datetime test_deque test_descr
    test_distutils test_minidom test_ordered_dict test_pickle test_set
    test_shutil test_tarfile test_typing test_weakset


Example of leak:

$ ./python -m test -R 3:3 test_descr -m test_issue24097
(...)
beginning 6 repetitions
123456
......
test_descr leaked [1, 1, 1] references, sum=3
test_descr failed (reference leak)
(...)

----------
components: Interpreter Core
messages: 416930
nosy: corona10, erlendaasland, pablogsal, serhiy.storchaka, vstinner
priority: normal
severity: normal
status: open
title: Add object.__getstate__() introduced a refleak
versions: Python 3.11

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47250>
_______________________________________


More information about the Python-bugs-list mailing list