Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(979)

Unified Diff: build/android/pylib/valgrind_tools.py

Issue 138153003: Switch to the "new" way of ASan deployment on Android devices. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/android/asan/asan_device_setup.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/valgrind_tools.py
diff --git a/build/android/pylib/valgrind_tools.py b/build/android/pylib/valgrind_tools.py
index c71b873b67f6754b5c0772be508701ebeaf5eec0..0eb0d7b6175dd159f5d74a21969ffd068d9659b1 100644
--- a/build/android/pylib/valgrind_tools.py
+++ b/build/android/pylib/valgrind_tools.py
@@ -22,6 +22,7 @@ Call tool.CleanUpEnvironment().
"""
import os.path
+import subprocess
import sys
from glob import glob
@@ -85,16 +86,11 @@ class BaseTool(object):
class AddressSanitizerTool(BaseTool):
"""AddressSanitizer tool."""
- TMP_DIR = '/data/local/tmp/asan'
- WRAPPER_NAME = 'asanwrapper.sh'
+ WRAPPER_NAME = '/system/bin/asanwrapper'
+ EXTRA_OPTIONS = 'allocator_may_return_null=1,strict_memcmp=0'
def __init__(self, adb):
self._adb = adb
- self._wrap_properties = ['wrap.com.google.android.apps.ch',
- 'wrap.org.chromium.native_test',
- 'wrap.org.chromium.content_shell',
- 'wrap.org.chromium.chrome.testsh',
- 'wrap.org.chromium.android_webvi']
# Configure AndroidCommands to run utils (such as md5sum_bin) under ASan.
# This is required because ASan is a compiler-based tool, and md5sum
# includes instrumented code from base.
@@ -102,17 +98,14 @@ class AddressSanitizerTool(BaseTool):
def CopyFiles(self):
"""Copies ASan tools to the device."""
- files = (['tools/android/asan/asanwrapper.sh'] +
- glob('third_party/llvm-build/Release+Asserts/lib/clang/*/lib/'
- 'linux/libclang_rt.asan-arm-android.so'))
- for f in files:
- self._adb.PushIfNeeded(os.path.join(DIR_SOURCE_ROOT, f),
- os.path.join(AddressSanitizerTool.TMP_DIR,
- os.path.basename(f)))
+ subprocess.call([os.path.join(DIR_SOURCE_ROOT,
+ 'tools/android/asan/asan_device_setup.sh'),
+ '--device', self._adb.GetDevice(),
+ '--extra-options', AddressSanitizerTool.EXTRA_OPTIONS])
+ self._adb.WaitForDevicePm()
def GetTestWrapper(self):
- return os.path.join(AddressSanitizerTool.TMP_DIR,
- AddressSanitizerTool.WRAPPER_NAME)
+ return AddressSanitizerTool.WRAPPER_NAME
def GetUtilWrapper(self):
"""Returns the wrapper for utilities, such as forwarder.
@@ -124,15 +117,9 @@ class AddressSanitizerTool(BaseTool):
def SetupEnvironment(self):
self._adb.EnableAdbRoot()
- self._adb.RunShellCommand('setenforce 0')
- for prop in self._wrap_properties:
- self._adb.RunShellCommand('setprop %s "logwrapper %s"' % (
- prop, self.GetTestWrapper()))
SetChromeTimeoutScale(self._adb, self.GetTimeoutScale())
def CleanUpEnvironment(self):
- for prop in self._wrap_properties:
- self._adb.RunShellCommand('setprop %s ""' % (prop,))
SetChromeTimeoutScale(self._adb, None)
def GetTimeoutScale(self):
« no previous file with comments | « no previous file | tools/android/asan/asan_device_setup.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698