Skip to content

[hwasan] Port "[Asan] Skip pre-split coroutine and noop coroutine frame (#99415)" #154803

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 2 commits into from
Aug 21, 2025

Conversation

thurstond
Copy link
Contributor

Originally suggested by rnk@

(this is the simplified function-level skip version, to unblock builds ASAP)

…me (llvm#99415)"

Originally suggested by rnk@
(this is the simplified function-level skip version, to unblock builds ASAP)
@llvmbot
Copy link
Member

llvmbot commented Aug 21, 2025

@llvm/pr-subscribers-compiler-rt-sanitizer

@llvm/pr-subscribers-llvm-transforms

Author: Thurston Dang (thurstond)

Changes

Originally suggested by rnk@

(this is the simplified function-level skip version, to unblock builds ASAP)


Full diff: https://github.com/llvm/llvm-project/pull/154803.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp (+3)
diff --git a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
index fc34d14259d1f..7457565269050 100644
--- a/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp
@@ -1574,6 +1574,9 @@ void HWAddressSanitizer::sanitizeFunction(Function &F,
   if (F.empty())
     return;
 
+  if(F.isPresplitCoroutine())
+    return;
+
   NumTotalFuncs++;
 
   OptimizationRemarkEmitter &ORE =

Copy link

github-actions bot commented Aug 21, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@thurstond
Copy link
Contributor Author

Failing test is unrelated (lldb-api.tools/lldb-dap/moduleSymbols/TestDAP_moduleSymbols.py - see https://github.com/llvm/llvm-project/actions/runs/17134632699?pr=154803)

@thurstond thurstond merged commit de64f85 into llvm:main Aug 21, 2025
8 of 9 checks passed
thurstond added a commit that referenced this pull request Aug 22, 2025
…with promise allocas (#154894)

ASan and HWASan did not play nicely with @llvm.coro.id's that had
non-null promises: rewriting the promise alloca violated the assumptions
of the coro-early pass (see
#154830 (comment)
for analysis). Although this issue has been worked around already in
ASan and HWASan (somewhat crudely, by disabling instrumentation for the
entire presplit function;
#99415,
#154803), there is no test
coverage to check the compiler would crash without the workarounds, if
coro-early was run after ASan/HWASan (the existing `split-coro.ll` runs
the passes in the opposite order and checks that ASan skips
instrumentation).

This patch adds simple tests (which succeed with the existing
workarounds, and would crash without). These will be useful for tracking
progress towards better workarounds.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Aug 22, 2025
…vm.coro.id with promise allocas (#154894)

ASan and HWASan did not play nicely with @llvm.coro.id's that had
non-null promises: rewriting the promise alloca violated the assumptions
of the coro-early pass (see
llvm/llvm-project#154830 (comment)
for analysis). Although this issue has been worked around already in
ASan and HWASan (somewhat crudely, by disabling instrumentation for the
entire presplit function;
llvm/llvm-project#99415,
llvm/llvm-project#154803), there is no test
coverage to check the compiler would crash without the workarounds, if
coro-early was run after ASan/HWASan (the existing `split-coro.ll` runs
the passes in the opposite order and checks that ASan skips
instrumentation).

This patch adds simple tests (which succeed with the existing
workarounds, and would crash without). These will be useful for tracking
progress towards better workarounds.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants