Skip to content

Commit e64c58b

Browse files
committed
add UBSan suppression file
1 parent dc12237 commit e64c58b

File tree

1 file changed

+136
-0
lines changed

1 file changed

+136
-0
lines changed

Tools/usan/usan.function.supp

+136
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
# List of UBSan suppressions for -fsanitize=function.
2+
#
3+
# For detecing the UBSan failures, Python was configured using:
4+
#
5+
# ./configure \
6+
# --with-pydebug \
7+
# --prefix="$(pwd)/build" \
8+
# CC=clang LD=clang \
9+
# CFLAGS="-fsanitize=function -fsanitize-recover" \
10+
# LDFLAGS="-fsanitize=function -fsanitize-recover"
11+
#
12+
# The list was then generated using the following script:
13+
#
14+
# PAT='runtime error: call to function (\w+) through pointer' && \
15+
# make -j12 2>&1 >/dev/null | \
16+
# grep -E "$PAT" | \
17+
# sed -r "s#^([^:]+).+: $PAT.+#\1@\2#g" | \
18+
# sort -k1,2 -t@ -u | \
19+
# awk 'BEGIN {
20+
# PROCINFO["sorted_in"]="@ind_num_asc";
21+
# FS=SUBSEP="@"
22+
# } {
23+
# A[$1][length(A[$1])+1]=$2
24+
# } END {
25+
# for (m in A) {
26+
# for (i in A[m]) {
27+
# if (i == 1) printf "function:%s\n", m;
28+
# print "#", A[m][i]
29+
# }
30+
# print ""
31+
# }
32+
# }' | \
33+
# sed -r "s#"$(pwd)"/?(\./)?(.+)#\2#g"
34+
#
35+
# Checking that a file does not err anymore is achieved via:
36+
#
37+
# make UBSAN_OPTIONS=suppressions="$(pwd)/Tools/usan/usan.function.supp"
38+
#
39+
# Note: currently, it appears that suppressing specific UBSan failures
40+
# for specific functions in specific files is not supported by Clang,
41+
# so we need to suppress the entire file.
42+
43+
function:Include/internal/pycore_call.h
44+
# partial_vectorcall
45+
46+
function:Include/internal/pycore_object.h
47+
# PyObject_Free
48+
49+
function:Objects/abstract.c
50+
# bytearray_ass_subscript
51+
# bytearray_iconcat
52+
# bytearray_releasebuffer
53+
# bytes_buffer_getbuffer
54+
# bytes_repeat
55+
# long_add
56+
# long_invert
57+
# long_mul
58+
# long_neg
59+
# set_ior
60+
# set_iter
61+
# setiter_iternext
62+
# set_len
63+
# tupleconcat
64+
# tuplecontains
65+
# tupleitem
66+
# tuplelength
67+
# tuplesubscript
68+
69+
function:Objects/call.c
70+
# lru_cache_call
71+
# partial_call
72+
73+
function:Objects/descrobject.c
74+
# bytes_decode
75+
# dict_items
76+
# dict_pop
77+
# func_get_name
78+
# func_set_name
79+
# _io_FileIO_close
80+
# list_append
81+
# rlock_acquire
82+
# rlock_release
83+
84+
function:Objects/listobject.c
85+
# gen_iternext
86+
87+
function:Objects/methodobject.c
88+
# dict_fromkeys
89+
# generic_init_subclass
90+
# int_from_bytes
91+
# _io_FileIO_readall
92+
# lock_PyThread_release_lock
93+
# type___subclasscheck__
94+
95+
function:Objects/moduleobject.c
96+
# locale_free
97+
98+
function:Objects/object.c
99+
# bytes_hash
100+
# bytes_richcompare
101+
# long_bool
102+
# _Py_module_getattro
103+
# set_len
104+
# tupleiter_dealloc
105+
# tuplelength
106+
107+
function:Objects/typeobject.c
108+
# AttributeError_init
109+
# ImportError_dealloc
110+
# tupletraverse
111+
112+
function:Python/bltinmodule.c
113+
# gen_iternext
114+
# reversed_next
115+
# unicode_ascii_iter_next
116+
117+
function:Python/gc.c
118+
# func_clear
119+
# gc_traverse
120+
# meth_traverse
121+
# module_traverse
122+
123+
function:Python/generated_cases.c.h
124+
# bytes_decode
125+
# dict_pop
126+
# list_append
127+
# list_extend
128+
# set_pop
129+
# typevar_typing_prepare_subst
130+
# unicode_ascii_iter_next
131+
132+
function:Python/hashtable.c
133+
# del_extensions_cache_value
134+
135+
function:Python/lock.c
136+
# init_types

0 commit comments

Comments
 (0)