classification
Title: test_faulthandler fails under ubsan
Type: Stage: resolved
Components: Build Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: benjamin.peterson, gregory.p.smith
Priority: normal Keywords: patch, patch, patch

Created on 2018-11-13 03:04 by benjamin.peterson, last changed 2018-12-31 04:35 by gregory.p.smith. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11381 merged gregory.p.smith, 2018-12-31 01:52
PR 11381 merged gregory.p.smith, 2018-12-31 01:52
PR 11381 merged gregory.p.smith, 2018-12-31 01:52
PR 11382 merged miss-islington, 2018-12-31 02:10
PR 11382 merged miss-islington, 2018-12-31 02:10
PR 11386 merged gregory.p.smith, 2018-12-31 03:59
PR 11386 merged gregory.p.smith, 2018-12-31 03:59
PR 11386 merged gregory.p.smith, 2018-12-31 03:59
PR 11386 merged gregory.p.smith, 2018-12-31 03:59
PR 11387 merged miss-islington, 2018-12-31 04:16
PR 11387 merged miss-islington, 2018-12-31 04:16
PR 11387 merged miss-islington, 2018-12-31 04:16
Messages (4)
msg329797 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2018-11-13 03:04
The UBsan buildbot is failing test_faulthandler. We should either spread some __attribute__((no_sanitize_undefined)) around or make the tests skip.

======================================================================
FAIL: test_enable_fd (test.test_faulthandler.FaultHandlerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 274, in test_enable_fd
    self.check_fatal_error("""
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 115, in check_fatal_error
    self.check_error(code, line_number, fatal_error, **kw)
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 108, in check_error
    output, exitcode = self.get_output(code, filename=filename, fd=fd)
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 73, in get_output
    self.assertEqual(output, '')
AssertionError: 'UndefinedBehaviorSanitizer:DEADLYSIGNAL\n[2619 chars]TING' != ''
Diff is 2693 characters long. Set self.maxDiff to None to see it.
======================================================================
FAIL: test_enable_file (test.test_faulthandler.FaultHandlerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 258, in test_enable_file
    self.check_fatal_error("""
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 115, in check_fatal_error
    self.check_error(code, line_number, fatal_error, **kw)
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 108, in check_error
    output, exitcode = self.get_output(code, filename=filename, fd=fd)
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 68, in get_output
    self.assertEqual(output, '')
AssertionError: 'UndefinedBehaviorSanitizer:DEADLYSIGNAL\n[2619 chars]TING' != ''
Diff is 2693 characters long. Set self.maxDiff to None to see it.
======================================================================
FAIL: test_sigfpe (test.test_faulthandler.FaultHandlerTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 176, in test_sigfpe
    self.check_fatal_error("""
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 115, in check_fatal_error
    self.check_error(code, line_number, fatal_error, **kw)
  File "/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Lib/test/test_faulthandler.py", line 110, in check_error
    self.assertRegex(output, regex)
AssertionError: Regex didn't match: '^Fatal Python error: Floating point exception\n\nCurrent thread 0x[0-9a-f]+ \\(most recent call first\\):\n  File "<string>", line 3 in <module>' not found in 'Modules/faulthandler.c:1059:11: runtime error: division by zero\nFatal Python error: Floating point exception\n\nCurrent thread 0x00007f14c5e81740 (most recent call first):\n  File "<string>", line 3 in <module>\nUndefinedBehaviorSanitizer:DEADLYSIGNAL\n==5027==ERROR: UndefinedBehaviorSanitizer: FPE on unknown address 0x006d000013a3 (pc 0x7f14c5355f9f bp 0x000002f485a0 sp 0x000002f698e8 T5027)\n    #0 0x7f14c5355f9e in gsignal (/lib/x86_64-linux-gnu/libpthread.so.0+0x10f9e)\n    #1 0x7f14c53560bf  (/lib/x86_64-linux-gnu/libpthread.so.0+0x110bf)\n    #2 0x829906 in faulthandler_sigfpe /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/./Modules/faulthandler.c:1059:11\n    #3 0x4707c3 in _PyMethodDef_RawFastCallKeywords /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Objects/call.c\n    #4 0x46e5d1 in _PyCFunction_FastCallKeywords /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Objects/call.c:730:14\n    #5 0x656805 in call_function /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:4570:9\n    #6 0x64b0d6 in _PyEval_EvalFrameDefault /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3164:23\n    #7 0x6596be in _PyEval_EvalCodeWithName /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3946:14\n    #8 0x6384ee in PyEval_EvalCodeEx /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:3975:12\n    #9 0x6384ee in PyEval_EvalCode /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/ceval.c:508\n    #10 0x6e816e in run_mod /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/pythonrun.c:1030:9\n    #11 0x6e816e in PyRun_StringFlags /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/pythonrun.c:954\n    #12 0x6e80bc in PyRun_SimpleStringFlags /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Python/pythonrun.c:450:9\n    #13 0x44db44 in pymain_run_command /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Modules/main.c:293:11\n    #14 0x44db44 in pymain_run_python /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Modules/main.c:1600\n    #15 0x44db44 in pymain_main /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Modules/main.c:1758\n    #16 0x44f29b in _Py_UnixMain /var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/Modules/main.c:1795:12\n    #17 0x7f14c4ba72e0 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x202e0)\n    #18 0x425499 in _start (/var/lib/buildbot/clang-ubsan/3.x.gps-clang-ubsan/build/python+0x425499)\n\nUndefinedBehaviorSanitizer can not provide additional info.\n==5027==ABORTING'
----------------------------------------------------------------------
msg332782 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-12-31 01:54
These are all related to the output of the child process containing sanitizer stuff so the stdout/stderr based tests are failing.

i skipped two of these for memory sanitizers, the third looks easy enough to fix via the regex.  PR attached.
msg332795 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-12-31 03:06
my test skipping logic is somehow not detecting my ubsan buildbot

https://buildbot.python.org/all/#/builders/135/builds/1108/steps/4/logs/stdio

TODO: figure that out.

otherwise the regex change fixed test_sigfpe.
msg332798 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-12-31 04:35
https://buildbot.python.org/all/#/builders/135/builds/1110

== Tests result: SUCCESS ==
404 tests OK.
10 slowest tests:
- test_tokenize: 3 min 43 sec
- test_concurrent_futures: 3 min 28 sec
- test_multiprocessing_spawn: 3 min 20 sec
- test_tools: 2 min 59 sec
- test_lib2to3: 2 min 23 sec
- test_multiprocessing_forkserver: 2 min 2 sec
- test_asyncio: 1 min 55 sec
- test_multiprocessing_fork: 1 min 28 sec
- test_subprocess: 1 min 15 sec
- test_io: 58 sec 708 ms
14 tests skipped:
    test_devpoll test_gdb test_ioctl test_kqueue test_msilib
    test_ossaudiodev test_startfile test_tix test_tk test_ttk_guionly
    test_winconsoleio test_winreg test_winsound test_zipfile64
History
Date User Action Args
2018-12-31 04:35:36gregory.p.smithsetstatus: open -> closed
messages: + msg332798

keywords: patch, patch, patch
resolution: fixed
stage: patch review -> resolved
2018-12-31 04:17:00miss-islingtonsetpull_requests: + pull_request10751
2018-12-31 04:16:56miss-islingtonsetpull_requests: + pull_request10750
2018-12-31 04:16:52miss-islingtonsetpull_requests: + pull_request10749
2018-12-31 03:59:27gregory.p.smithsetpull_requests: + pull_request10747
2018-12-31 03:59:23gregory.p.smithsetpull_requests: + pull_request10748
2018-12-31 03:59:20gregory.p.smithsetpull_requests: + pull_request10746
2018-12-31 03:59:17gregory.p.smithsetpull_requests: + pull_request10745
2018-12-31 03:06:22gregory.p.smithsetkeywords: patch, patch, patch

messages: + msg332795
2018-12-31 02:10:59miss-islingtonsetpull_requests: + pull_request10734
2018-12-31 02:10:56miss-islingtonsetpull_requests: + pull_request10733
2018-12-31 01:54:18gregory.p.smithsetkeywords: patch, patch, patch

messages: + msg332782
2018-12-31 01:53:12gregory.p.smithsetkeywords: patch, patch, patch
assignee: gregory.p.smith

nosy: + gregory.p.smith
2018-12-31 01:52:49gregory.p.smithsetkeywords: + patch
stage: patch review
pull_requests: + pull_request10732
2018-12-31 01:52:46gregory.p.smithsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10731
2018-12-31 01:52:42gregory.p.smithsetkeywords: + patch
stage: (no value)
pull_requests: + pull_request10730
2018-11-13 03:04:30benjamin.petersoncreate