⚡ Sangsakala Proxy 🏠 Home
Skip to content

gh-161288: fix perf trampoline crash on UBSan builds - #161294

Open
NekoAsakura wants to merge 2 commits into
python:mainfrom
NekoAsakura:gh-161288/perf-trampoline-ubsan
Open

NekoAsakura wants to merge 2 commits into
python:mainfrom
NekoAsakura:gh-161288/perf-trampoline-ubsan

Conversation

@NekoAsakura

@NekoAsakura NekoAsakura commented Nov 4, 2026 •

Copy link
Copy Markdown
Member

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I tested building Python with ./configure --with-undefined-behavior-sanitizer CC=clang LD=clang && make clean && make.

Without the fix, ./python -X perf -c pass logs a huge UBSan error and exit the process.

With the fix, ./python -X perf -c pass and ./python -X perf_jit -c pass complete successfully.

I confirm that #if __has_feature(undefined_behavior_sanitizer) test is true in C code built with clang -fsanitize=function or -fsanitize=undefined.

cc @pablogsal @StanFromIreland

@StanFromIreland

Copy link
Copy Markdown
Member

test_samply_profiler has the same skip:

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")

It can probably be removed as well (I haven't checked)?

@NekoAsakura

Copy link
Copy Markdown
Member Author

@StanFromIreland Good catch, dropped it too.

@vstinner
vstinner enabled auto-merge (squash) November 4, 2026 19:28
@vstinner vstinner added needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes labels Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting merge needs backport to 3.14 bugs and security fixes needs backport to 3.15 bugs and security fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants