Skip to content

test_tkinter leaks references on Windows #111531

Closed

Activity

  1. changed the title [-]test_tkinter leaks references[/-] [+]test_tkinter leaks references on Windows[/+] on Oct 31, 2023
  2. vstinner commented on Oct 31, 2023

    @vstinner
    MemberAuthor

    git bisect points me to PR #111202 and commit 9bb202a:

    9bb202a1a90ef0edce20c495c9426d9766df11bb is the first bad commit
    commit 9bb202a1a90ef0edce20c495c9426d9766df11bb
    Author: Serhiy Storchaka <storchaka@gmail.com>
    Date:   Tue Oct 24 13:02:12 2023 +0300
    
        gh-75666: Tkinter: add tests for binding (GH-111202)
    
     Lib/test/test_tkinter/test_misc.py | 307 +++++++++++++++++++++++++++++++++++++
     1 file changed, 307 insertions(+)
    
  3. terryjreedy commented on Oct 31, 2023

    @terryjreedy
    Member

    @serhiy-storchaka
    f:\dev\3x>python -m test -ugui -R3:3 -m BindTest test_tkinter.test_misc
    ...
    test_tkinter.test_misc leaked [336, 336, 336] references, sum=1008
    test_tkinter.test_misc leaked [151, 151, 151] memory blocks, sum=453
    test_tkinter.test_misc failed (reference leak)

    I am running experiments to see which individual tests leak.

  4. added a commit that references this issue on Oct 31, 2023
  5. terryjreedy commented on Oct 31, 2023

    @terryjreedy
    Member

    I initially commented out blocks, then changed the -m arg to a test name and checked for only 1 match.
    Leaks are pretty well spread out. Results, possibly with errors:
    test_??? name(s): references, blocks

    bind, unbind, unbind2: 6, 0
    rebind, bind_class: 30,16
    unbind_class: 30, 8
    bind_class_rebind: 46, 18
    bind_all: 30, 18
    bind_tags: 0, 0
    bind_events: 102, 59
    unbind_all: 38, 20
    bind_all_rebind: 53, 20

  6. serhiy-storchaka commented on Oct 31, 2023

    @serhiy-storchaka
    Member

    Thank you for your report Victor. It is not only on Windows.

    I knew that something may be wrong with bind_class() and bind_all(), and was going to open a new issue when found a reproducer, but I did not know that it also causes leaks.

  7. serhiy-storchaka commented on Oct 31, 2023

    @serhiy-storchaka
    Member

    Thank you for your tests Terry. Could you please also check if #111533 fixes leaks? I do not see leaks in bind() on Linux, all leaks were in bind_class() and bind_all().

  8. added a commit that references this issue on Oct 31, 2023
  9. added 2 commits that reference this issue on Oct 31, 2023
  10. added 2 commits that reference this issue on Oct 31, 2023
  11. vstinner commented on Oct 31, 2023

    @vstinner
    MemberAuthor

    Oh, that was a quick fix 👍

  12. added a commit that references this issue on Nov 3, 2023
  13. added a commit that references this issue on Feb 11, 2024
  14. added a commit that references this issue on Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions