0:01:16 load avg: 26.11 [485/486/5] test_regrtest failed (1 failure) (38.8 sec) -- running (1): test_socket (35.7 sec)
test test_regrtest failed -- Traceback (most recent call last):
File "/$HOME/lib/python/cpython/Lib/test/test_regrtest.py", line 2289, in test_xml
output = self.run_tests(testname, "--junit-xml", filename,
exitcode=EXITCODE_BAD_TEST)
File "/$HOME/lib/python/cpython/Lib/test/test_regrtest.py", line 927, in run_tests
return self.run_python(cmdargs, **kw)
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
File "/$HOME/lib/python/cpython/Lib/test/test_regrtest.py", line 777, in run_python
proc = self.run_command(args, **kw)
File "/$HOME/lib/python/cpython/Lib/test/test_regrtest.py", line 768, in run_command
self.fail(msg)
~~~~~~~~~^^^^^
AssertionError: Command ['/$HOME/lib/python/cpython/python', '-X', 'faulthandler', '-I', '-m', 'test', '--testdir=/tmp/test_python_3mwd8cdm/tmpsfkk6fdz', 'test_regrtest_noop51', '--junit-xml', '@test_12395_tmpæ'] failed with exit code 1, but exit code 2 expected!
stdout:
---
Using random seed: 777580575
0:00:00 load avg: 26.11 Run 1 test sequentially in a single process
0:00:00 load avg: 26.11 [1/1] test_regrtest_noop51
test test_regrtest_noop51 failed -- Traceback (most recent call last):
File "/tmp/test_python_3mwd8cdm/tmpsfkk6fdz/test_regrtest_noop51.py", line 8, in test_failed
self.fail()
~~~~~~~~~^^
AssertionError: None
Stdout:
abc ef
Stdout:
abc ef
Modules/expat/xmlparse.c:3162:9: runtime error: call to function expat_start_handler through pointer to incorrect function type 'void (*)(void *, const char *, const char **)'
/$HOME/lib/python/cpython/./Modules/_elementtree.c:3259: note: expat_start_handler defined here
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior Modules/expat/xmlparse.c:3162:9
---
0:01:46 load avg: 16.11 running (1): test_socket (1 min 5 sec)
^C
Bug report
Bug description:
We finally managed to fix gh-111178, but this is assuming that Python is compiled with
-fsanitize=function. When compiling Python as follows (with clang 18.1.8):we still have some tests failing:
Others related to the second item above:
Details
Others on fautlhandler, but I'm not sure whether this is the UB that is being reported or something else:
Details
Finally,
test_regrtestalso fails but the test suite just hangs after crashing (but the UB seems to happen in a test related to XML so it's probably the same thing):Details
CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
PyCFunctionand others #131665