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

Memory leak in the compiler in case of errors #78261

Closed
serhiy-storchaka opened this issue Jul 10, 2018 · 7 comments
Closed

Memory leak in the compiler in case of errors #78261

serhiy-storchaka opened this issue Jul 10, 2018 · 7 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage

Comments

@serhiy-storchaka
Copy link
Member

BPO 34080
Nosy @vstinner, @serhiy-storchaka, @miss-islington
PRs
  • bpo-34080: Fix a memory leak in the compiler. #8222
  • bpo-34080: Fix memory leak on parsing error #8242
  • [3.7] bpo-34080: Fix a memory leak in the compiler. (GH-8222) #8256
  • [3.6] bpo-34080: Fix a memory leak in the compiler. (GH-8222) #8257
  • [2.7] bpo-34080: Fix a memory leak in the compiler. (GH-8222) #8258
  • 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 2018-07-11.22:06:11.805>
    created_at = <Date 2018-07-10.08:20:42.010>
    labels = ['interpreter-core', '3.7', '3.8', 'performance']
    title = 'Memory leak in the compiler in case of errors'
    updated_at = <Date 2018-07-11.22:06:11.803>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2018-07-11.22:06:11.803>
    actor = 'vstinner'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2018-07-11.22:06:11.805>
    closer = 'vstinner'
    components = ['Interpreter Core']
    creation = <Date 2018-07-10.08:20:42.010>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34080
    keywords = ['patch']
    message_count = 7.0
    messages = ['321367', '321419', '321500', '321504', '321506', '321507', '321508']
    nosy_count = 3.0
    nosy_names = ['vstinner', 'serhiy.storchaka', 'miss-islington']
    pr_nums = ['8222', '8242', '8256', '8257', '8258']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue34080'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7', 'Python 3.8']

    @serhiy-storchaka
    Copy link
    Member Author

    Merging PR 6517 for bpo-33305 exposed a leak in the compiler:

    https://buildbot.python.org/all/#/builders/1/builds/280

    $ ./python -m test -R 3:3 test_compile test_grammar
    Run tests sequentially
    0:00:00 load avg: 1.95 [1/2] test_compile
    beginning 6 repetitions
    123456
    ......
    test_compile leaked [15, 16, 15] memory blocks, sum=46
    0:00:14 load avg: 1.97 [2/2/1] test_grammar -- test_compile failed
    beginning 6 repetitions
    123456
    ......
    test_grammar leaked [50, 50, 50] memory blocks, sum=150
    test_grammar failed

    == Tests result: FAILURE ==

    2 tests failed:
    test_compile test_grammar

    Total duration: 15 sec 226 ms
    Tests result: FAILURE

    This branch was not common, but after bpo-33305 it has became more common and heavily tested.

    @serhiy-storchaka serhiy-storchaka added 3.7 (EOL) end of life 3.8 only security fixes labels Jul 10, 2018
    @serhiy-storchaka serhiy-storchaka self-assigned this Jul 10, 2018
    @serhiy-storchaka serhiy-storchaka added interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage labels Jul 10, 2018
    @vstinner
    Copy link
    Member

    Related issue: bpo-34084.

    @vstinner
    Copy link
    Member

    New changeset 993030a by Victor Stinner (Serhiy Storchaka) in branch 'master':
    bpo-34080: Fix a memory leak in the compiler. (GH-8222)
    993030a

    @miss-islington
    Copy link
    Contributor

    New changeset a45fa39 by Miss Islington (bot) in branch '2.7':
    bpo-34080: Fix a memory leak in the compiler. (GH-8222)
    a45fa39

    @miss-islington
    Copy link
    Contributor

    New changeset 9beed0c by Miss Islington (bot) in branch '3.7':
    bpo-34080: Fix a memory leak in the compiler. (GH-8222)
    9beed0c

    @vstinner
    Copy link
    Member

    New changeset 3b06285 by Victor Stinner (Miss Islington (bot)) in branch '3.6':
    bpo-34080: Fix a memory leak in the compiler. (GH-8222) (GH-8257)
    3b06285

    @vstinner
    Copy link
    Member

    Thanks Serhiy for the fix! It seems that new tests helped to find a real bug ;-)

    @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 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) performance Performance or resource usage
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants