aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2017-05-05 15:29:20 -0700
committerDan Willemsen <dwillemsen@google.com>2017-05-05 16:59:10 -0700
commita3e6c520ac835ce22eb130bda8e043d829093052 (patch)
tree1d13dee4d3b68e789915035d9f045df53c87f40f /ui
parent269a8c78e7c33a0253073ea6b136583650ab7051 (diff)
downloadbuild_soong-a3e6c520ac835ce22eb130bda8e043d829093052.tar.gz
build_soong-a3e6c520ac835ce22eb130bda8e043d829093052.tar.bz2
build_soong-a3e6c520ac835ce22eb130bda8e043d829093052.zip
Always run asan ckati on the build servers
We're seeing some rare crashes that appear to be stack overflows. To get better debugging, use the asan version of ckati when 'dist' is specified. Bug: 36182021 Test: m -j Test: m -j dist Test: make -j dist (w/o lunch) Change-Id: Ic3a5590974bfd718bf1929355d344b5933ac1d4f
Diffstat (limited to 'ui')
-rw-r--r--ui/build/config.go18
-rw-r--r--ui/build/kati.go3
2 files changed, 16 insertions, 5 deletions
diff --git a/ui/build/config.go b/ui/build/config.go
index f5007b1b..e21e1fab 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -319,13 +319,21 @@ func (c *configImpl) HostPrebuiltTag() string {
}
}
-func (c *configImpl) PrebuiltBuildTool(name string) string {
+func (c *configImpl) HostAsan() bool {
if v, ok := c.environ.Get("SANITIZE_HOST"); ok {
if sanitize := strings.Fields(v); inList("address", sanitize) {
- asan := filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "asan/bin", name)
- if _, err := os.Stat(asan); err == nil {
- return asan
- }
+ return true
+ }
+ }
+ return false
+}
+
+func (c *configImpl) PrebuiltBuildTool(name string) string {
+ // (b/36182021) We're seeing rare ckati crashes, so always enable asan kati on the build servers.
+ if c.HostAsan() || (c.Dist() && name == "ckati") {
+ asan := filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "asan/bin", name)
+ if _, err := os.Stat(asan); err == nil {
+ return asan
}
}
return filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "bin", name)
diff --git a/ui/build/kati.go b/ui/build/kati.go
index f29d0c19..972b5591 100644
--- a/ui/build/kati.go
+++ b/ui/build/kati.go
@@ -100,6 +100,9 @@ func runKati(ctx Context, config Config) {
}
cmd.Stderr = cmd.Stdout
+ // Kati leaks memory, so ensure leak detection is turned off
+ cmd.Environment.Set("ASAN_OPTIONS", "detect_leaks=0")
+
cmd.StartOrFatal()
katiRewriteOutput(ctx, pipe)
cmd.WaitOrFatal()