Message271143
Xiang: I don’t think we need to make the tests do anything special. Just make sure they exercise the code that handles overflows. I have been running the test suite without any -j0 option, and I can look over the output and see the error messages. Or if we get to a stage where all the errors are eliminated, you could run with UBSAN_OPTIONS=halt_on_error=1. E.g. in this patch, I add two simple tests to cover parts of the code that weren’t covered before (and if I hadn’t fixed the overflows, the tests would trigger extra UBSAN errors).
ctypes_v2.patch is an update of array-size.patch. I improved the test case, and added a new fix for overflows like the following:
>>> class S(ctypes.Structure):
... _fields_ = (("field", ctypes.c_longlong, 64),)
...
>>> s = S()
>>> s.field = 3
Modules/_ctypes/cfield.c:900:9: runtime error: signed integer overflow: -9223372036854775808 - 1 cannot be represented in type 'long long int' |
|
Date |
User |
Action |
Args |
2016-07-24 12:08:28 | martin.panter | set | recipients:
+ martin.panter, loewis, nnorwitz, gregory.p.smith, jcea, mark.dickinson, pitrou, vstinner, christian.heimes, alexandre.vassalotti, donmez, matejcik, jwilk, alex, dmalcolm, python-dev, deadshort, serhiy.storchaka, ztane, fweimer, Jeffrey.Walton, xiang.zhang |
2016-07-24 12:08:27 | martin.panter | set | messageid: <1469362107.95.0.825995741477.issue1621@psf.upfronthosting.co.za> |
2016-07-24 12:08:27 | martin.panter | link | issue1621 messages |
2016-07-24 12:08:26 | martin.panter | create | |
|