Author martin.panter
Recipients Jeffrey.Walton, alex, alexandre.vassalotti, christian.heimes, deadshort, dmalcolm, donmez, fweimer, gregory.p.smith, gvanrossum, jcea, jwilk, loewis, mark.dickinson, martin.panter, matejcik, nnorwitz, pitrou, python-dev, vstinner, ztane
Date 2016-07-15.02:53:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468551216.85.0.516904819054.issue1621@psf.upfronthosting.co.za>
In-reply-to
Content
Inspired by Issue 27473, I did a quick and dirty scan for obvious places that expect overflow to wrap, and found the following, which I think should be fixed:

Modules/_ctypes/_ctypes.c:1388, in PyCArrayType_new()
Objects/listobject.c:492, in list_concat()
Objects/tupleobject.c:457, in tupleconcat()
Objects/listobject.c:845, in listextend()

Also I played with enabling GCC’s -ftrapv option. Attached is a patch with three changes:

1. configure --with-pydebug enables -ftrapv (experimental, not sure everyone would want this)

2. Easy fix for negation overflow in audioop (I am happy to apply this part)

3. Avoid dumb overflows at end of for loop in Element Tree code when handling slices with step=sys.maxsize. Technically the overflow is undefined behaviour, but the change is annoying, because ignoring the overflow at the end of the loop is much simpler than adding special cases. Not sure what I think about this part.
History
Date User Action Args
2016-07-15 02:53:37martin.pantersetrecipients: + martin.panter, gvanrossum, loewis, nnorwitz, gregory.p.smith, jcea, mark.dickinson, pitrou, vstinner, christian.heimes, alexandre.vassalotti, donmez, matejcik, jwilk, alex, dmalcolm, python-dev, deadshort, ztane, fweimer, Jeffrey.Walton
2016-07-15 02:53:36martin.pantersetmessageid: <1468551216.85.0.516904819054.issue1621@psf.upfronthosting.co.za>
2016-07-15 02:53:36martin.panterlinkissue1621 messages
2016-07-15 02:53:34martin.pantercreate