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
This commit is contained in:
Elliott Hughes
2023-10-05 14:50:48 -07:00
parent 4ac292ffd8
commit 3bba0e4bfe

View File

@@ -86,7 +86,7 @@ var (
memtagStackCommonFlags = []string{"-march=armv8-a+memtag", "-mllvm", "-dom-tree-reachability-max-bbs-to-explore=128"} memtagStackCommonFlags = []string{"-march=armv8-a+memtag", "-mllvm", "-dom-tree-reachability-max-bbs-to-explore=128"}
hostOnlySanitizeFlags = []string{"-fno-sanitize-recover=all"} hostOnlySanitizeFlags = []string{"-fno-sanitize-recover=all"}
deviceOnlySanitizeFlags = []string{"-fsanitize-trap=all", "-ftrap-function=abort"} deviceOnlySanitizeFlags = []string{"-fsanitize-trap=all"}
noSanitizeLinkRuntimeFlag = "-fno-sanitize-link-runtime" noSanitizeLinkRuntimeFlag = "-fno-sanitize-link-runtime"
) )