This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author alexandre.vassalotti
Recipients alexandre.vassalotti
Date 2010-09-28.00:07:43
SpamBayes Score 0.000537445
Marked as misclassified No
Message-id <1285632468.19.0.235987005106.issue9965@psf.upfronthosting.co.za>
In-reply-to
Content
This was mentioned during the review of issue #9410
(http://codereview.appspot.com/1694050/diff/2001/3001#newcode347), however we forgot to fix this.

The new array-based memo for the Unpickler class assumes incorrectly that memo indices are always contiguous. This is not the case. And due to this, the following pickle will cause Unpickler to use about 3GB of memory to store the memo array.

./python -c "import pickle; pickle.loads(b'\x80\x02]r\xff\xff\xff\x06.')"

To fix this, we can add code to fall-back to a dictionary-based memo when the memo keys are not contiguous.
History
Date User Action Args
2010-09-28 00:07:48alexandre.vassalottisetrecipients: + alexandre.vassalotti
2010-09-28 00:07:48alexandre.vassalottisetmessageid: <1285632468.19.0.235987005106.issue9965@psf.upfronthosting.co.za>
2010-09-28 00:07:45alexandre.vassalottilinkissue9965 messages
2010-09-28 00:07:43alexandre.vassalotticreate