From 3bba0e4bfe0472eb145868757aff1359da42c388 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 5 Oct 2023 14:50:48 -0700 Subject: [PATCH] Have the sanitizers trap rather than abort. abort() seems friendlier, but in practice it puts a couple of irrelevant libc.so frames on the top of the stack trace and clobbers all the registers that might have helped remotely debug a sanitizer failure. Let's switch to trapping directly in the sanitized code instead. Bug: http://b/298741930 Test: treehugger Change-Id: I6c971920c8506f97133749aaddd73b8cea6a12bc --- cc/sanitize.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/sanitize.go b/cc/sanitize.go index 6329e9769..6624d4b92 100644 --- a/cc/sanitize.go +++ b/cc/sanitize.go @@ -86,7 +86,7 @@ var ( memtagStackCommonFlags = []string{"-march=armv8-a+memtag", "-mllvm", "-dom-tree-reachability-max-bbs-to-explore=128"} hostOnlySanitizeFlags = []string{"-fno-sanitize-recover=all"} - deviceOnlySanitizeFlags = []string{"-fsanitize-trap=all", "-ftrap-function=abort"} + deviceOnlySanitizeFlags = []string{"-fsanitize-trap=all"} noSanitizeLinkRuntimeFlag = "-fno-sanitize-link-runtime" )