From 4a88e23c6625f160be8c20227bac0368f35cb6b3 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Mon, 24 Mar 2025 14:57:26 +0100 Subject: [PATCH] gh-111178: Skip tests which require deep stack if UBsan If Python is built with Undefined Behavior sanitizer, skip test_repr_deep() of test_userdict and test_lru_recursion() of test_functools. --- Lib/test/mapping_tests.py | 1 + Lib/test/test_functools.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/test/mapping_tests.py b/Lib/test/mapping_tests.py index 1a0caa00fcd49e..9d38da5a86ee5a 100644 --- a/Lib/test/mapping_tests.py +++ b/Lib/test/mapping_tests.py @@ -624,6 +624,7 @@ def __repr__(self): @support.skip_wasi_stack_overflow() @support.skip_emscripten_stack_overflow() + @support.skip_if_sanitizer("requires deep stack", ub=True) def test_repr_deep(self): d = self._empty_mapping() for i in range(support.exceeds_recursion_limit()): diff --git a/Lib/test/test_functools.py b/Lib/test/test_functools.py index fe096fa075865f..0bbfcfd0369cf3 100644 --- a/Lib/test/test_functools.py +++ b/Lib/test/test_functools.py @@ -2078,7 +2078,7 @@ def orig(a, /, b, c=True): ... @support.skip_on_s390x @unittest.skipIf(support.is_wasi, "WASI has limited C stack") - @support.skip_if_sanitizer("requires deep stack", thread=True) + @support.skip_if_sanitizer("requires deep stack", ub=True, thread=True) @support.skip_emscripten_stack_overflow() def test_lru_recursion(self):