-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[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
Conversation
…me (llvm#99415)" Originally suggested by rnk@ (this is the simplified function-level skip version, to unblock builds ASAP)
@llvm/pr-subscribers-compiler-rt-sanitizer @llvm/pr-subscribers-llvm-transforms Author: Thurston Dang (thurstond) ChangesOriginally 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:
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 =
|
✅ With the latest revision this PR passed the C/C++ code formatter. |
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) |
…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.
…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.
Originally suggested by rnk@
(this is the simplified function-level skip version, to unblock builds ASAP)