8000 gh-111178: Skip test_perf_profiler on function sanitizer by vstinner · Pull Request #132020 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111178: Skip test_perf_profiler on function sanitizer #132020

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
gh-111178: Skip test_perf_profiler on function sanitizer
Add function parameter to check_sanitizer() of test.support.
  • Loading branch information
vstinner committed Apr 2, 2025
commit f9381b142aea3891a445ed2a2785d540c823c83f
9 changes: 7 additions & 2 deletions Lib/test/support/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,8 @@ def skip_if_buildbot(reason=None):
isbuildbot = False
return unittest.skipIf(isbuildbot, reason)

def check_sanitizer(*, address=False, memory=False, ub=False, thread=False):
def check_sanitizer(*, address=False, memory=False, ub=False, thread=False,
function=True):
"""Returns True if Python is compiled with sanitizer support"""
if not (address or memory or ub or thread):
raise ValueError('At least one of address, memory, ub or thread must be True')
Expand All @@ -433,11 +434,15 @@ def check_sanitizer(*, address=False, memory=False, ub=False, thread=False):
'-fsanitize=thread' in cflags or
'--with-thread-sanitizer' in config_args
)
function_sanitizer = (
'-fsanitize=function' in cflags
)
return (
(memory and memory_sanitizer) or
(address and address_sanitizer) or
(ub and ub_sanitizer) or
(thread and thread_sanitizer)
(thread and thread_sanitizer) or
(function and function_sanitizer)
)


Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_perf_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
if not support.has_subprocess_support:
raise unittest.SkipTest("test module requires subprocess")

if support.check_sanitizer(address=True, memory=True, ub=True):
if support.check_sanitizer(address=True, memory=True, ub=True, function=True):
# gh-109580: Skip the test because it does crash randomly if Python is
# built with ASAN.
raise unittest.SkipTest("test crash randomly on ASAN/MSAN/UBSAN build")
Expand Down
Loading
0