New submission from Jeffrey Walton:
Checked out Python-3.5 from mercurial. Compiled with Clang 3.4, added
-fsanitzie=undefined to CFLAGS. Ran 'make' and 'make check'. A few issues
during `make`:
Objects/longobject.c:40:42: runtime error: index -3 out of bounds for type
'PyLongObject [262]'
Objects/listobject.c:2046:22: runtime error: index 623 out of bounds for type
'PyObject *[256]'
Objects/longobject.c:40:42: runtime error: index -3 out of bounds for type
'PyLongObject [262]'
Similar issues with `make test`, with the addition of some mis-aligned
pointers. A digest is below, and the tagCDataObject alignment issue dominates
the issues. The tests ended early due to a segfault.
$ make test
...
[ 19/389/1] test_struct
Objects/longobject.c:40:42: runtime error: index -3 out of bounds for type
'PyLongObject [262]'
/home/jwalton/Desktop/cpython-checkout/Objects/floatobject.c:2028: runtime
error: value 3.40282e+38 is outside the range of representable values of type
'float'
/home/jwalton/Desktop/cpython-checkout/Modules/_struct.c:792:15: runtime error:
left shift of 72057594037927935 by 8 places cannot be represented in type 'long
long'
...
[ 43/389/2] test_cmd_line
Objects/longobject.c:40:42: runtime error: index -3 out of bounds for type
'PyLongObject [262]'
Objects/longobject.c:40:42: runtime error: index -3 out of bounds for type
'PyLongObject [262]'
Objects/longobject.c:40:42: runtime error: index -3 out of bounds for type
'PyLongObject [262]'
/home/jwalton/Desktop/cpython-checkout/Modules/_ctypes/_ctypes.c:2890:10:
runtime error: member access within misaligned address 0x2b54033f1cc8 for type
'CDataObject' (aka 'struct tagCDataObject'), which requires 16 byte alignment
0x2b54033f1cc8: note: pointer points here
ff ff ff ff 01 00 00 00 00 00 00 00 68 06 43 03 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00
^
test test_cmd_line failed -- multiple errors occurred; run in verbose mode for
details
...
[ 45/389/2] test_datetime
Objects/longobject.c:40:42: runtime error: index -3 out of bounds for type
'PyLongObject [262]'
/home/jwalton/Desktop/cpython-checkout/Python/pytime.c:218: runtime error:
value -1e+200 is outside the range of representable values of type 'long'
/home/jwalton/Desktop/cpython-checkout/Python/pytime.c:218: runtime error:
value 1e+200 is outside the range of representable values of type 'long'
...
test test_traceback failed -- Traceback (most recent call last):
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/test_traceback.py",
line 155, in test_encoded_file
do_test("", "foo", "ascii", 3)
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/test_traceback.py",
line 132, in do_test
stdout = stdout.decode(output_encoding).splitlines()
LookupError: unknown encoding: Objects/longobject.c:40:42: runtime error: index
-3 out of bounds for type 'PyLongObject [262]'
...
[130/389/5] test_capi
Objects/longobject.c:40:42: runtime error: index -3 out of bounds for type
'PyLongObject [262]'
Fatal Python error: Segmentation fault
Current thread 0x00002b6eaf8c7b20 (most recent call first):
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/test_capi.py", line 466
in test__testcapi
File "/home/jwalton/Desktop/cpython-checkout/Lib/unittest/case.py", line 574
in run
File "/home/jwalton/Desktop/cpython-checkout/Lib/unittest/case.py", line 622
in __call__
File "/home/jwalton/Desktop/cpython-checkout/Lib/unittest/suite.py", line 125
in run
File "/home/jwalton/Desktop/cpython-checkout/Lib/unittest/suite.py", line 87
in __call__
File "/home/jwalton/Desktop/cpython-checkout/Lib/unittest/suite.py", line 125
in run
File "/home/jwalton/Desktop/cpython-checkout/Lib/unittest/suite.py", line 87
in __call__
File "/home/jwalton/Desktop/cpython-checkout/Lib/unittest/suite.py", line 125
in run
File "/home/jwalton/Desktop/cpython-checkout/Lib/unittest/suite.py", line 87
in __call__
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/support/__init__.py",
line 1584 in run
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/support/__init__.py",
line 1685 in _run_suite
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/support/__init__.py",
line 1719 in run_unittest
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/regrtest.py", line 1277
in <lambda>
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/regrtest.py", line 1278
in runtest_inner
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/regrtest.py", line 978
in runtest
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/regrtest.py", line 532
in main
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/regrtest.py", line 1562
in main_in_temp_cwd
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/regrtest.py", line 1587
in <module>
File "/home/jwalton/Desktop/cpython-checkout/Lib/runpy.py", line 86 in
_run_code
File "/home/jwalton/Desktop/cpython-checkout/Lib/runpy.py", line 171 in
_run_module_as_main
Traceback (most recent call last):
File "/home/jwalton/Desktop/cpython-checkout/Lib/runpy.py", line 171, in
_run_module_as_main
"__main__", mod_spec)
File "/home/jwalton/Desktop/cpython-checkout/Lib/runpy.py", line 86, in
_run_code
exec(code, run_globals)
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/__main__.py", line 3,
in <module>
regrtest.main_in_temp_cwd()
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/regrtest.py", line
1562, in main_in_temp_cwd
main()
File "/home/jwalton/Desktop/cpython-checkout/Lib/test/regrtest.py", line 738,
in main
raise Exception("Child error on {}: {}".format(test, result[1]))
Exception: Child error on test_capi: Exit code -11
make: *** [test] Error 1
----------
components: Build
files: python-3.5-make.txt
messages: 213625
nosy: Jeffrey.Walton
priority: normal
severity: normal
status: open
title: Undefined behavior flagged by Clang 3.4 (Python 3.5 from hg)
type: compile error
versions: Python 3.5
Added file: http://bugs.python.org/file34428/python-3.5-make.txt
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20932>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com