Skip to content

Commit f53b736

Browse files
authored
Merge branch '3.14' into backport-9aa731f-3.14
2 parents 417e017 + d0eff57 commit f53b736

4 files changed

Lines changed: 13 additions & 3 deletions

File tree

‎Include/pyport.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,9 @@ extern "C" {
605605
# define _Py_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
606606
# endif
607607
# endif
608+
# if __has_feature(undefined_behavior_sanitizer)
609+
# define _Py_NO_SANITIZE_FUNCTION __attribute__((no_sanitize("function")))
610+
# endif
608611
#elif defined(__GNUC__)
609612
# if defined(__SANITIZE_ADDRESS__)
610613
# define _Py_ADDRESS_SANITIZER
@@ -629,6 +632,9 @@ extern "C" {
629632
#ifndef _Py_NO_SANITIZE_MEMORY
630633
# define _Py_NO_SANITIZE_MEMORY
631634
#endif
635+
#ifndef _Py_NO_SANITIZE_FUNCTION
636+
# define _Py_NO_SANITIZE_FUNCTION
637+
#endif
632638
#ifndef _Py_MSAN_UNPOISON
633639
# define _Py_MSAN_UNPOISON(PTR, SIZE)
634640
#endif

‎Lib/test/test_perf_profiler.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@
1717
if not support.has_subprocess_support:
1818
raise unittest.SkipTest("test module requires subprocess")
1919

20-
if support.check_sanitizer(address=True, memory=True, ub=True, function=True):
20+
if support.check_sanitizer(address=True, memory=True, function=False):
2121
# gh-109580: Skip the test because it does crash randomly if Python is
2222
# built with ASAN.
23-
raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build")
23+
raise unittest.SkipTest("test crash randomly on ASAN/MSAN build")
2424

2525

2626
def supports_trampoline_profiling():
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Fix a crash in the perf trampoline (:option:`-X perf <-X>`) on builds with
2+
clang's ``-fsanitize=function``, which ``-fsanitize=undefined`` enables
3+
since clang 17.

‎Python/perf_trampoline.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ compile_trampoline(void)
433433
return code_arena_new_code(perf_code_arena);
434434
}
435435

436-
static PyObject *
436+
// gh-161288: the trampoline has no -fsanitize=function type signature
437+
static PyObject * _Py_NO_SANITIZE_FUNCTION
437438
py_trampoline_evaluator(PyThreadState *ts, _PyInterpreterFrame *frame,
438439
int throw)
439440
{

0 commit comments

Comments
 (0)