Skip to content

Commit 9a16536

Browse files
committed
CI: Let the ASan self-check case reach ASan
The second CI run showed the planted read is caught, but by UBSan's object-size check, which halts first. Build the fault-planting extension with -fno-sanitize=object-size so that case proves ASan; the signed-overflow case already proves UBSan. Refs #41
1 parent 82f6d7c commit 9a16536

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎python-multiplatform-ksp/tools/sanitizers.py‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,11 @@ def cmd_selfcheck() -> int:
136136
src = work / "tp_faulty.c"
137137
src.write_text(FAULTY_C)
138138
so = work / ("tp_faulty" + sysconfig.get_config_var("EXT_SUFFIX"))
139-
build = cc() + SAN_FLAGS + ["-fPIC", "-shared", f"-I{sysconfig.get_paths()['include']}", str(src),
139+
# UBSan's object-size check would stop the planted out-of-bounds read before ASan sees it (seen
140+
# on the first CI run). Disable it for this fault-planting build only, so the ASan case proves
141+
# ASan itself; UBSan is proven by the signed-overflow case.
142+
build = cc() + SAN_FLAGS + ["-fno-sanitize=object-size", "-fPIC", "-shared",
143+
f"-I{sysconfig.get_paths()['include']}", str(src),
140144
"-o", str(so)]
141145
if sys.platform == "darwin":
142146
build += ["-undefined", "dynamic_lookup"]

0 commit comments

Comments
 (0)