Message270562
I tried the newer -fsanitize=undefined mode, and it is better than -ftrapv. It adds instrumentation that by default nicely reports the errors and continues running.
My problem with the large slice step is not restricted to Element Tree; it affects list objects too:
>>> "abcdef"[3::sys.maxsize]
Objects/unicodeobject.c:13794:55: runtime error: signed integer overflow: 3 + 9223372036854775807 cannot be represented in type 'long int'
'd'
Regarding Antti’s overflow macros, I noticed there is already a macro _PyTime_check_mul_overflow() in Python/pytime.c which does that kind of thing. Maybe it could help, though I am not sure. Has this sort of thing been done in other projects? We might need to be careful about the sign, e.g. clarify the macro is only for positive values, add an assertion, or handle both positive and negative. |
|
Date |
User |
Action |
Args |
2016-07-16 15:16:00 | martin.panter | set | recipients:
+ 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, serhiy.storchaka, ztane, fweimer, Jeffrey.Walton |
2016-07-16 15:16:00 | martin.panter | set | messageid: <1468682160.67.0.551884707716.issue1621@psf.upfronthosting.co.za> |
2016-07-16 15:16:00 | martin.panter | link | issue1621 messages |
2016-07-16 15:16:00 | martin.panter | create | |
|