STINNER Victor added the comment:

The failing unit test was added by:

commit 2d350fd8af29eada0c3f264a91df6ab4af4a05fd
Author: Antoine Pitrou <solip...@pitrou.net>
Date:   Thu Aug 1 20:56:12 2013 +0200

    Issue #18619: Fix atexit leaking callbacks registered from 
sub-interpreters, and make it GC-aware.


Using git bisect, I found that the leak was introduced by:

commit 6b4be195cd8868b76eb6fbe166acc39beee8ce36
Author: Eric Snow <ericsnowcurren...@gmail.com>
Date:   Mon May 22 21:36:03 2017 -0700

    bpo-22257: Small changes for PEP 432. (#1728)
    
    PEP 432 specifies a number of large changes to interpreter startup code, 
including exposing a cleaner C-API. The major changes depend on a number of 
smaller changes. This patch includes all those smaller changes.


To run a git bisection, start with an old commit, 1 month ago: 
5d7a8d0c13737fd531b722ad76c505ef47aac96a (May, 1). Spoiler: the test doesn't 
leak at this bisection.

git bisect reset
git bisect start

git checkout master
make && ./python -m test -R 3:3 -m test_callbacks_leak test_atexit
# test fails
git bisect bad  # bad=test fails (ref leak)

git checkout 5d7a8d0c13737fd531b722ad76c505ef47aac96a
make && ./python -m test -R 3:3 -m test_callbacks_leak test_atexit
# test pass
git bisect good  # good=test pass (no leak)

make && ./python -m test -R 3:3 -m test_callbacks_leak test_atexit
# git bisect good or bad depending on the test result

# ... continue until git bisect finds the commit ...

At the end, you should get the commit 6b4be195cd8868b76eb6fbe166acc39beee8ce36.


@Eric Snow: Please don't fix the bug, please explain how to fix it ;-)

----------
nosy: +eric.snow

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30547>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to