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

Leak in _PyTraceback_Add #67970

Closed
serhiy-storchaka opened this issue Mar 26, 2015 · 5 comments
Closed

Leak in _PyTraceback_Add #67970

serhiy-storchaka opened this issue Mar 26, 2015 · 5 comments
Assignees
Labels
3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@serhiy-storchaka
Copy link
Member

BPO 23782
Nosy @birkenfeld, @vstinner, @serhiy-storchaka
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • _PyTraceback_Add_leak.patch
  • _PyTraceback_Add_leak2.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 = 'https://github.com/serhiy-storchaka'
    closed_at = <Date 2016-10-18.10:32:08.782>
    created_at = <Date 2015-03-26.10:25:02.400>
    labels = ['interpreter-core', '3.7', 'performance']
    title = 'Leak in _PyTraceback_Add'
    updated_at = <Date 2017-03-31.16:36:21.501>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:21.501>
    actor = 'dstufft'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2016-10-18.10:32:08.782>
    closer = 'serhiy.storchaka'
    components = ['Interpreter Core']
    creation = <Date 2015-03-26.10:25:02.400>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['43473', '45036']
    hgrepos = []
    issue_num = 23782
    keywords = ['patch']
    message_count = 5.0
    messages = ['239319', '239321', '268857', '278358', '278852']
    nosy_count = 4.0
    nosy_names = ['georg.brandl', 'vstinner', 'python-dev', 'serhiy.storchaka']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue23782'
    versions = ['Python 3.5', 'Python 3.6', 'Python 3.7']

    @serhiy-storchaka
    Copy link
    Member Author

    There is a leak of fetched exception in _PyTraceback_Add() (Python/traceback.c:146).

    @serhiy-storchaka serhiy-storchaka added the performance Performance or resource usage label Mar 26, 2015
    @vstinner
    Copy link
    Member

    If a new exception is raised by _PyTraceback_Add(), the original exception is lost. It's sad because _PyTraceback_Add() is supposed to enhance the current exception, not to drop it.

    In the draft of my PEP-490, I propose to chain the two exceptions.

    @serhiy-storchaka
    Copy link
    Member Author

    Proposed patch fixes a leak.

    @serhiy-storchaka serhiy-storchaka added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label Jun 19, 2016
    @serhiy-storchaka serhiy-storchaka self-assigned this Jul 17, 2016
    @serhiy-storchaka
    Copy link
    Member Author

    More refactoring.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 18, 2016

    New changeset 6b3be9f38f2a by Serhiy Storchaka in branch '3.5':
    Issue bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
    https://hg.python.org/cpython/rev/6b3be9f38f2a

    New changeset 2d352bf2b228 by Serhiy Storchaka in branch '3.6':
    Issue bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
    https://hg.python.org/cpython/rev/2d352bf2b228

    New changeset 83877018ef97 by Serhiy Storchaka in branch 'default':
    Issue bpo-23782: Fixed possible memory leak in _PyTraceback_Add() and exception
    https://hg.python.org/cpython/rev/83877018ef97

    @serhiy-storchaka serhiy-storchaka added the 3.7 (EOL) end of life label Oct 18, 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
    3.7 (EOL) end of life interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants