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

Possible reference leak in MAKE_FUNCTION #71178

Closed
zhangyangyu opened this issue May 10, 2016 · 6 comments
Closed

Possible reference leak in MAKE_FUNCTION #71178

zhangyangyu opened this issue May 10, 2016 · 6 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@zhangyangyu
Copy link
Member

BPO 26991
Nosy @serhiy-storchaka, @zhangyangyu
Files
  • make_function_reference_leak.patch
  • make_function_reference_leak_new.patch
  • 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 2016-05-17.05:54:33.496>
    created_at = <Date 2016-05-10.11:00:17.423>
    labels = ['interpreter-core', 'type-bug']
    title = 'Possible reference leak in MAKE_FUNCTION'
    updated_at = <Date 2016-05-17.05:54:33.494>
    user = 'https://github.com/zhangyangyu'

    bugs.python.org fields:

    activity = <Date 2016-05-17.05:54:33.494>
    actor = 'python-dev'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-05-17.05:54:33.496>
    closer = 'python-dev'
    components = ['Interpreter Core']
    creation = <Date 2016-05-10.11:00:17.423>
    creator = 'xiang.zhang'
    dependencies = []
    files = ['42794', '42795']
    hgrepos = []
    issue_num = 26991
    keywords = ['patch']
    message_count = 6.0
    messages = ['265235', '265236', '265239', '265252', '265680', '265757']
    nosy_count = 3.0
    nosy_names = ['python-dev', 'serhiy.storchaka', 'xiang.zhang']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue26991'
    versions = ['Python 3.6']

    @zhangyangyu
    Copy link
    Member Author

    *names* is not Py_DECREFed in MAKE_FUNCTION in error case.

    @zhangyangyu
    Copy link
    Member Author

    Sorry, wrong patch. Attach the right one.

    @serhiy-storchaka
    Copy link
    Member

    LGTM. Would be nice to have a test (just compile a function with annotations in a loop).

    @serhiy-storchaka serhiy-storchaka added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error labels May 10, 2016
    @zhangyangyu
    Copy link
    Member Author

    I'm willing to. But I don't know where is the suitable place to put such a test and since the reference leak only appears in error case, can compile a function with annotations in a loop accomplish the test goal?

    @serhiy-storchaka
    Copy link
    Member

    I don't know what is the best place for this function. You can just break compiling functions with annotations, run tests, found tests that use functions with annotations, and add new test near one of them.

    You can test your test by removing the fix and running the test with the "-R :" option.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented May 17, 2016

    New changeset eaa3a71a6f62 by Benjamin Peterson in branch '3.5':
    fix possible refleak in MAKE_FUNCTION (closes bpo-26991)
    https://hg.python.org/cpython/rev/eaa3a71a6f62

    New changeset 7270701cf5bc by Benjamin Peterson in branch 'default':
    merge 3.5 (bpo-26991)
    https://hg.python.org/cpython/rev/7270701cf5bc

    @python-dev python-dev mannequin closed this as completed May 17, 2016
    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants