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 christian.heimes
Recipients christian.heimes, loewis, python-dev, serhiy.storchaka
Date 2014-08-14.21:10:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1408050647.75.0.926106918321.issue22193@psf.upfronthosting.co.za>
In-reply-to
Content
The code is missing an overflow check. There should be some verification that __sizeof__ returns a value smaller than SIZE_T_MAX - 24. Also 24 for GC overhead looks strange. IMHO it should be sizeof(PyGC_Head) which can be smaller than 24 bytes.

Python 3.5.0a0 (default:601045ceff94, Aug 14 2014, 22:59:49) 
[GCC 4.8.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> class Overflow:
...     def __sizeof__(self):
...         return (1<<64)-1
... 
>>> sys.getsizeof(Overflow())
23
History
Date User Action Args
2014-08-14 21:10:47christian.heimessetrecipients: + christian.heimes, loewis, python-dev, serhiy.storchaka
2014-08-14 21:10:47christian.heimessetmessageid: <1408050647.75.0.926106918321.issue22193@psf.upfronthosting.co.za>
2014-08-14 21:10:47christian.heimeslinkissue22193 messages
2014-08-14 21:10:47christian.heimescreate