[issue20932] Undefined behavior flagged by Clang 3.4 (Python 3.5 from hg)

Jeffrey Walton report at bugs.python.org
Sat Mar 15 04:53:10 CET 2014


Jeffrey Walton added the comment:

Pulled the latest after BP cleared some more runtime errors:

  $ hg summary
  parent: 89662:7ce22d0899e4 tip
   merge 3.3
  branch: default
  commit: 2 modified
  update: (current)

Misaligned accesses dominate with over 11K:

  $ cat python-3.5-make-test.txt | grep misaligned | wc -l
  11320

*****

$ make test
...

[ 21/389] test_sort
Objects/listobject.c:1973:30: runtime error: index 257 out of bounds for type 'PyObject *[256]'
...
[ 31/389] test_xml_etree
/home/jwalton/Desktop/cpython-checkout/Modules/expat/xmltok.c:1396:11: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
/home/jwalton/Desktop/cpython-checkout/Modules/expat/xmltok.c:1398:16: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
...
[ 33/389] test_aifc
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1587:39: runtime error: left shift of negative value -24
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1546:19: runtime error: left shift of negative value -24
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1513:43: runtime error: left shift of negative value -24
...
[ 61/389] test_httplib
/home/jwalton/Desktop/cpython-checkout/Lib/socket.py:444: ResourceWarning: unclosed <ssl.SSLSocket fd=4, family=AddressFamily.AF_INET, type=2049, proto=6, laddr=('172.16.1.26', 51321), raddr=('82.94.164.164', 443)>
  self._sock = None
...
[ 99/389] test_audioop
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1060:20: runtime error: left shift of negative value -70
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1061:20: runtime error: left shift of negative value -70
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1811:9: runtime error: left shift of negative value -22
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1811:9: runtime error: left shift of negative value -22
...
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:422:11: runtime error: left shift of negative value -1
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1639:19: runtime error: left shift of negative value -69
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1639:19: runtime error: left shift of negative value -17767
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1639:19: runtime error: left shift of negative value -70
/home/jwalton/Desktop/cpython-checkout/Modules/audioop.c:1639:19: runtime error: left shift of negative value -4548489
...
[109/389] test_unicode
/home/jwalton/Desktop/cpython-checkout/Modules/_ctypes/_ctypes.c:2890:10: runtime error: member access within misaligned address 0x2ac5068c24f8 for type 'CDataObject' (aka 'struct tagCDataObject'), which requires 16 byte alignment
0x2ac5068c24f8: note: pointer points here
 ff ff ff ff  01 00 00 00 00 00 00 00  78 e4 af 02 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^ 
/home/jwalton/Desktop/cpython-checkout/Modules/_ctypes/_ctypes.c:2891:10: runtime error: member access within misaligned address 0x2ac5068c24f8 for type 'CDataObject' (aka 'struct tagCDataObject'), which requires 16 byte alignment
0x2ac5068c24f8: note: pointer points here
 ff ff ff ff  01 00 00 00 00 00 00 00  78 e4 af 02 00 00 00 00  00 00 00 00 00 00 00 00  00 00 00 00
              ^ 
...
/home/jwalton/Desktop/cpython-checkout/Modules/_ctypes/_ctypes.c:3862:5: runtime error: member access within misaligned address 0x2ae9f1252e58 for type 'PyCFuncPtrObject', which requires 16 byte alignment
0x2ae9f1252e58: note: pointer points here
 00 00 00 00  01 00 00 00 00 00 00 00  58 0c 8e 02 00 00 00 00  a8 2e 25 f1 e9 2a 00 00  01 00 00 00
              ^ 
/home/jwalton/Desktop/cpython-checkout/Modules/_ctypes/_ctypes.c:3863:5: runtime error: member access within misaligned address 0x2ae9f1252e58 for type 'PyCFuncPtrObject', which requires 16 byte alignment
0x2ae9f1252e58: note: pointer points here
 00 00 00 00  01 00 00 00 00 00 00 00  58 0c 8e 02 00 00 00 00  a8 2e 25 f1 e9 2a 00 00  01 00 00 00
              ^ 
...
2 tests failed:
    test_faulthandler test_venv
2 tests altered the execution environment:
    test___all__ test_warnings
25 tests skipped:
    test_bz2 test_crypt test_curses test_dbm_gnu test_dbm_ndbm
    test_devpoll test_gdb test_gzip test_idle test_kqueue test_lzma
    test_msilib test_nis test_ossaudiodev test_readline test_sqlite
    test_startfile test_tcl test_tk test_ttk_guionly test_ttk_textonly
    test_winreg test_winsound test_zipfile64 test_zlib

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20932>
_______________________________________


More information about the Python-bugs-list mailing list