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 on unpickling bogus data #69911

Closed
serhiy-storchaka opened this issue Nov 24, 2015 · 6 comments
Closed

Memory leak on unpickling bogus data #69911

serhiy-storchaka opened this issue Nov 24, 2015 · 6 comments
Assignees
Labels
performance Performance or resource usage stdlib Python modules in the Lib dir

Comments

@serhiy-storchaka
Copy link
Member

BPO 25725
Nosy @pitrou, @vstinner, @avassalotti, @serhiy-storchaka
Files
  • load_counted_tuple_leak.patch
  • pickle.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 2015-11-25.13:09:28.704>
    created_at = <Date 2015-11-24.20:49:41.565>
    labels = ['library', 'performance']
    title = 'Memory leak on unpickling bogus data'
    updated_at = <Date 2015-11-25.13:09:28.703>
    user = 'https://github.com/serhiy-storchaka'

    bugs.python.org fields:

    activity = <Date 2015-11-25.13:09:28.703>
    actor = 'serhiy.storchaka'
    assignee = 'serhiy.storchaka'
    closed = True
    closed_date = <Date 2015-11-25.13:09:28.704>
    closer = 'serhiy.storchaka'
    components = ['Library (Lib)']
    creation = <Date 2015-11-24.20:49:41.565>
    creator = 'serhiy.storchaka'
    dependencies = []
    files = ['41154', '41156']
    hgrepos = []
    issue_num = 25725
    keywords = ['patch']
    message_count = 6.0
    messages = ['255289', '255290', '255295', '255297', '255300', '255338']
    nosy_count = 5.0
    nosy_names = ['pitrou', 'vstinner', 'alexandre.vassalotti', 'python-dev', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'resource usage'
    url = 'https://bugs.python.org/issue25725'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5', 'Python 3.6']

    @serhiy-storchaka
    Copy link
    Member Author

    New tests added in bpo-23914 exposed memory leak on unpickling TUPLE1..TUPLE3 opcodes with insufficient stack. Proposed patch fixes the leak.

    @serhiy-storchaka serhiy-storchaka self-assigned this Nov 24, 2015
    @serhiy-storchaka serhiy-storchaka added stdlib Python modules in the Lib dir performance Performance or resource usage labels Nov 24, 2015
    @serhiy-storchaka
    Copy link
    Member Author

    $ ./python -m test.regrtest -R 3:3 -m test_bad_stack test_pickle
    [1/1] test_pickle
    beginning 6 repetitions
    123456
    ......
    test_pickle leaked [20, 20, 20] references, sum=60
    test_pickle leaked [12, 14, 14] memory blocks, sum=40
    1 test failed:
        test_pickle

    @vstinner
    Copy link
    Member

    Oh... I didn't notice that you wrote a patch :-) I started to write a similar patch: see attached pickle.patch.

    @vstinner
    Copy link
    Member

    I reviewed load_counted_tuple_leak.patch.

    Forget my patch, Serhiy's patch is better.

    @serhiy-storchaka
    Copy link
    Member Author

    You patch is just the first version of my patch. :-) But tests are crashed with it.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Nov 25, 2015

    New changeset c85eca74f3a5 by Serhiy Storchaka in branch '3.4':
    Issue bpo-25725: Fixed a reference leak in pickle.loads() when unpickling
    https://hg.python.org/cpython/rev/c85eca74f3a5

    New changeset 88ad2b8480b1 by Serhiy Storchaka in branch '3.5':
    Issue bpo-25725: Fixed a reference leak in pickle.loads() when unpickling
    https://hg.python.org/cpython/rev/88ad2b8480b1

    New changeset 935debb548a3 by Serhiy Storchaka in branch 'default':
    Issue bpo-25725: Fixed a reference leak in pickle.loads() when unpickling
    https://hg.python.org/cpython/rev/935debb548a3

    New changeset 9a4db1ac5e10 by Serhiy Storchaka in branch '2.7':
    Issue bpo-25725: Fixed a reference leak in cPickle.loads() when unpickling
    https://hg.python.org/cpython/rev/9a4db1ac5e10

    @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
    performance Performance or resource usage stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants