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 vstinner
Recipients eryksun, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2017-06-02.08:58:24
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1496393904.76.0.689922881358.issue30547@psf.upfronthosting.co.za>
In-reply-to
Content
http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.6/builds/15/steps/test/logs/stdio

0:02:58 [ 28/405/2] test_atexit failed
......
beginning 6 repetitions
123456

test_atexit leaked [12, 12, 12] references, sum=36
test_atexit leaked [4, 4, 4] memory blocks, sum=12


Code of of the test:

    def test_callbacks_leak(self):
        # This test shows a leak in refleak mode if atexit doesn't
        # take care to free callbacks in its per-subinterpreter module
        # state.
        n = atexit._ncallbacks()
        code = r"""if 1:
            import atexit
            def f():
                pass
            atexit.register(f)
            del atexit
            """
        ret = support.run_in_subinterp(code)
        self.assertEqual(ret, 0)
        self.assertEqual(atexit._ncallbacks(), n)


Hum, I don't understand: the test leaks references on purpose?


To reproduce the bug, use the command:

python -m test -R 3:3 -m test_callbacks_leak test_atexit


Note: Leak isolated my bisect_test.py of bpo-29512.
History
Date User Action Args
2017-06-02 08:58:24vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, eryksun, steve.dower
2017-06-02 08:58:24vstinnersetmessageid: <1496393904.76.0.689922881358.issue30547@psf.upfronthosting.co.za>
2017-06-02 08:58:24vstinnerlinkissue30547 messages
2017-06-02 08:58:24vstinnercreate