Martin Panter added the comment:
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'
----------
Added file: http://bugs.python.org/file43855/ctypes_v2.patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue1621>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com