classification
Title: Memory leak on unpickling bogus data
Type: resource usage Stage: resolved
Components: Library (Lib) Versions: Python 3.6, Python 3.4, Python 3.5, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: alexandre.vassalotti, pitrou, python-dev, serhiy.storchaka, vstinner
Priority: normal Keywords: patch

Created on 2015-11-24 20:49 by serhiy.storchaka, last changed 2015-11-25 13:09 by serhiy.storchaka. This issue is now closed.

Files
File name Uploaded Description Edit
load_counted_tuple_leak.patch serhiy.storchaka, 2015-11-24 20:49 review
pickle.patch vstinner, 2015-11-24 22:42 review
Messages (6)
msg255289 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-24 20:49
New tests added in issue23914 exposed memory leak on unpickling TUPLE1..TUPLE3 opcodes with insufficient stack. Proposed patch fixes the leak.
msg255290 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-24 20:51
$ ./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
msg255295 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-11-24 22:42
Oh... I didn't notice that you wrote a patch :-) I started to write a similar patch: see attached pickle.patch.
msg255297 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2015-11-24 22:45
I reviewed load_counted_tuple_leak.patch.

Forget my patch, Serhiy's patch is better.
msg255300 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-24 23:03
You patch is just the first version of my patch. :-)  But tests are crashed with it.
msg255338 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-11-25 13:08
New changeset c85eca74f3a5 by Serhiy Storchaka in branch '3.4':
Issue #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 #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 #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 #25725: Fixed a reference leak in cPickle.loads() when unpickling
https://hg.python.org/cpython/rev/9a4db1ac5e10
History
Date User Action Args
2015-11-25 13:09:28serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2015-11-25 13:08:53python-devsetnosy: + python-dev
messages: + msg255338
2015-11-24 23:03:24serhiy.storchakasetmessages: + msg255300
2015-11-24 22:45:12vstinnersetmessages: + msg255297
2015-11-24 22:42:31vstinnersetfiles: + pickle.patch

messages: + msg255295
2015-11-24 20:51:45serhiy.storchakasetmessages: + msg255290
2015-11-24 20:50:19vstinnersetnosy: + vstinner
2015-11-24 20:49:41serhiy.storchakacreate