[issue9530] integer undefined behaviors
John Regehr added the comment: I the tests for today's cpython using IOC and got only the issues below. The on-purpose divide by zero should be OK but the shift by -2 probably wants to be fixed. ARITHMETIC UNDEFINED at : Op: <<=, Reason : Signed Left Shift: Right operand is negative or is greater than or equal to the width of the promoted left operand, BINARY OPERATION: left (int32): 0 right (int32): -2 ARITHMETIC UNDEFINED at <./Modules/faulthandler.c, (844:11)> : Op: /, Reason : Signed Division: Divisor is 0 || divident is INT_MIN, divisor is -1, BINARY OPERATION: left (int32): 1 right (int32): 0 version info: regehr@home:~/tmp/cpython$ ./python Python 3.3.0a4+ (default:24369f6c4a22+, Jun 20 2012, 16:41:04) [GCC 4.2.1 Compatible Clang 3.1 ((branches/release_31))] on linux Type "help", "copyright", "credits" or "license" for more information. -- ___ Python tracker <http://bugs.python.org/issue9530> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9530] integer undefined behaviors
John Regehr added the comment: Hi folks, I realize it was a long time ago that I reported this issue! Since then our tool has been made available: http://embed.cs.utah.edu/ioc/ In particular, that web page contains a pre-compiled version of the tool for recent Ubuntu on x86-64, that should be pretty easy to use. Alternatively, I can re-run the Python test suite on a Python compiled using our tool. Let me know if this would be helpful. -- ___ Python tracker <http://bugs.python.org/issue9530> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9530] integer undefined behaviors
John Regehr added the comment: Hi Mark, yes you can run the overflow checker but "easy instructions" depends on whether you feel like building your own LLVM. It is not at all difficult, but it's certainly not as easy as "apt-get install ...". Patch and instructions are here: http://embed.cs.utah.edu/ioc/ If/when we get this into LLVM (the earliest possible release containing IOC will be 3.1), I'll let you know. Thanks again. -- ___ Python tracker <http://bugs.python.org/issue9530> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9530] integer undefined behaviors
John Regehr added the comment: This is great. I'd be happy to re-run the tests sometime, and also we're talking with the LLVM folks about getting our patches into the main LLMM tree. Basically it'll act as a more powerful -ftrapv, and the error message will be much better than "aborted". -- ___ Python tracker <http://bugs.python.org/issue9530> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9530] integer undefined behaviors
John Regehr added the comment: Hi Mark-- Glad it's useful! We plan to release this tool but haven't done so yet, it still has rough edges. It's LLVM-based and it seems likely they will take our patches. -- ___ Python tracker <http://bugs.python.org/issue9530> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9530] integer undefined behaviors
New submission from John Regehr : I ran "make test" for today's Python3k snapshot under a tool which detects math operations that the C language considers to have undefined behavior. This was on x86 Linux. The list of undefined behaviors is attached. Hopefully they are self-explanatory, but please let me know if more details are needed. -- files: python-errors.txt messages: 113079 nosy: regehr priority: normal severity: normal status: open title: integer undefined behaviors type: behavior versions: Python 3.3 Added file: http://bugs.python.org/file18412/python-errors.txt ___ Python tracker <http://bugs.python.org/issue9530> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com