Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_curses is leaking references #87274

Closed
pablogsal opened this issue Feb 2, 2021 · 6 comments
Closed

test_curses is leaking references #87274

pablogsal opened this issue Feb 2, 2021 · 6 comments
Labels
3.10 only security fixes tests Tests in the Lib/test dir

Comments

@pablogsal
Copy link
Member

BPO 43108
Nosy @vstinner, @serhiy-storchaka, @pablogsal, @miss-islington
PRs
  • bpo-43108: Fix a reference leak in the curses module #24420
  • [3.8] bpo-43108: Fix a reference leak in the curses module (GH-24420) #24429
  • [3.9] bpo-43108: Fix a reference leak in the curses module (GH-24420) #24430
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-02-02.21:51:25.870>
    created_at = <Date 2021-02-02.20:02:14.514>
    labels = ['tests', '3.10']
    title = 'test_curses is leaking references'
    updated_at = <Date 2021-02-15.20:55:52.180>
    user = 'https://github.com/pablogsal'

    bugs.python.org fields:

    activity = <Date 2021-02-15.20:55:52.180>
    actor = 'vstinner'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-02-02.21:51:25.870>
    closer = 'pablogsal'
    components = ['Tests']
    creation = <Date 2021-02-02.20:02:14.514>
    creator = 'pablogsal'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 43108
    keywords = ['patch']
    message_count = 6.0
    messages = ['386166', '386168', '386170', '386202', '387041', '387060']
    nosy_count = 4.0
    nosy_names = ['vstinner', 'serhiy.storchaka', 'pablogsal', 'miss-islington']
    pr_nums = ['24420', '24429', '24430']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue43108'
    versions = ['Python 3.10']

    @pablogsal
    Copy link
    Member Author

    ❯ ./python -m test test_curses -uall -R :
    0:00:00 load avg: 3.77 Run tests sequentially
    0:00:00 load avg: 3.77 [1/1] test_curses
    beginning 9 repetitions
    123456789
    .
    test_curses leaked [4, 4, 4, 4] references, sum=16
    test_curses failed

    == Tests result: FAILURE ==

    1 test failed:
    test_curses

    Total duration: 2.5 sec
    Tests result: FAILURE

    https://buildbot.python.org/all/#/builders/75/builds/168/steps/5/logs/stdio

    @pablogsal pablogsal added 3.10 only security fixes tests Tests in the Lib/test dir labels Feb 2, 2021
    @pablogsal
    Copy link
    Member Author

    d64fd4b is the first bad commit
    commit d64fd4b
    Author: Serhiy Storchaka <storchaka@gmail.com>
    Date: Sun Jan 31 17:22:27 2021 +0200

    bpo-43016: Rewrite tests for curses (GH-24312)
    

    Lib/test/test_curses.py | 1002 +++++++++++++++++++++++++++++++++++++----------
    1 file changed, 787 insertions(+), 215 deletions(-)

    @pablogsal
    Copy link
    Member Author

    New changeset bb739ec by Pablo Galindo in branch 'master':
    bpo-43108: Fix a reference leak in the curses module (GH-24420)
    bb739ec

    @miss-islington
    Copy link
    Contributor

    New changeset 12bfc59 by Miss Islington (bot) in branch '3.9':
    bpo-43108: Fix a reference leak in the curses module (GH-24420)
    12bfc59

    @pablogsal
    Copy link
    Member Author

    New changeset ede1ff2 by Miss Islington (bot) in branch '3.8':
    bpo-43108: Fix a reference leak in the curses module (GH-24420) (GH-24429)
    ede1ff2

    @vstinner
    Copy link
    Member

    The funny part is that the bug was there for 4 years. It's good that Serhiy added new tests to allow to catch this old bug!

    commit f7eae0a
    Author: Serhiy Storchaka <storchaka@gmail.com>
    Date: Wed Jun 28 08:30:06 2017 +0300

    [security] bpo-13617: Reject embedded null characters in wchar* strings. (bpo-2302)
    
    Based on patch by Victor Stinner.
    
    Add private C API function _PyUnicode_AsUnicode() which is similar to
    PyUnicode_AsUnicode(), but checks for null characters.
    

    It wasn't me! Ok, maybejust a little bit :-D

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes tests Tests in the Lib/test dir
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants