This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Add a Linux clang ubsan undefined behavior sanitizer buildbot
Type: compile error Stage: resolved
Components: Build Versions: Python 3.8, Python 3.7, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: gregory.p.smith Nosy List: gregory.p.smith, martin.panter
Priority: normal Keywords: buildbot

Created on 2018-04-20 23:48 by gregory.p.smith, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (3)
msg315542 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-04-20 23:48
CPython needs to be regularly built and vetted for C undefined behavior.

CFLAGS=-fsanitize=undefined LDFLAGS=-fsanitize=undefined CC=clang LD=clang ./configure

is all it takes to start with.

if you do this today, test_ctypes will knock your socks off with errors.  We should detect this type of build and intentionally skip its tests on ubsan, tracking that with another yet to be filed issue.

I'll look into having Google run one.
msg317088 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2018-05-19 01:38
Perhaps your “ctypes” problems may be helped by my ctypes_v2.patch in Issue 1621. Or perhaps they are already documented in Issue 15119 and/or Issue 28169.
msg317188 - (view) Author: Gregory P. Smith (gregory.p.smith) * (Python committer) Date: 2018-05-20 16:52
A buildbot is up and running:
  http://buildbot.python.org/all/#/builders?tags=%2Bubsan

in order to see the errors though, you have to manually string search for "runtime error" in the giant test logs stdout.

At the moment, Modules/_ctypes/_ctypes.c dominates the error lists with misaligned access problems - I suggest filtering that out and looking for the others to start with for anyone working on these issues.
History
Date User Action Args
2022-04-11 14:58:59adminsetgithub: 77502
2018-05-20 16:53:22gregory.p.smithsetstatus: open -> closed
resolution: fixed
stage: resolved
2018-05-20 16:52:59gregory.p.smithsetmessages: + msg317188
2018-05-19 01:38:02martin.pantersetnosy: + martin.panter
messages: + msg317088
2018-04-23 01:17:36Cavemansetversions: + Python 2.7
2018-04-20 23:48:21gregory.p.smithcreate