aboutsummaryrefslogtreecommitdiff
path: root/en/devices/tech/debug/asan.html
diff options
context:
space:
mode:
authorAndroid Partner Docs <noreply@android.com>2017-06-19 21:12:35 -0700
committerClay Murphy <claym@google.com>2017-06-20 13:09:22 -0700
commitd72514453123a8634ae55406807d77f03362a2bd (patch)
treeb528f70cbfa22decfea5899870efc1a42e7b7778 /en/devices/tech/debug/asan.html
parent8560a623b8040782583740e9dd1cbc4be310a568 (diff)
downloadsource.android.com-d72514453123a8634ae55406807d77f03362a2bd.tar.gz
Docs: Changes to source.android.com
- 159519221 Add CTS Media 1.3 file link by claym <claym@google.com> - 159296442 Changed devsite tag classes on a couple pages. by cqn <cqn@google.com> - 159296357 Add devsite class to tags in devices/tech/power by cqn <cqn@google.com> - 159296314 Added devsite class to tags in compatibility/cts. by cqn <cqn@google.com> - 159296265 Added devsite class to tags in devices/tech/ota. by cqn <cqn@google.com> - 159273197 Added devsite class to tags for devices/tech/test_infra/t... by cqn <cqn@google.com> - 159269559 Add speed-profile and verify-profile to the list of options by claym <claym@google.com> - 159268556 Add devsite class to tags in devices/tech/display by cqn <cqn@google.com> - 159247742 Add devsite class to tags in devices/tech/admin by cqn <cqn@google.com> - 159246177 Finished adding devsite class to tags on devices/tech/debug by cqn <cqn@google.com> - 159245597 Add devsite tag to classes in devices/tech/debug by cqn <cqn@google.com> - 159128910 Changed breaks to paragraph tags for formatting, and adde... by cqn <cqn@google.com> - 159115811 Add devsite class to tags for devices/tech/config by cqn <cqn@google.com> - 159115392 Added devsite class to tags on devices/tech/connect and d... by cqn <cqn@google.com> - 159114997 Add devsite class to tags in devices/storage and devices/tv by cqn <cqn@google.com> - 158948331 Provide advice to OEM and carrier app developers to reduc... by Android Partner Docs <noreply@android.com> - 158920824 Add devsite class to tags in devices/tech/dalvik by cqn <cqn@google.com> - 158917965 Fix links to sensors.h reference file by claym <claym@google.com> - 158916603 Docs: moving gdb to own page, updating index by hvm <hvm@google.com> - 158915436 Update Security acknowledgement with new researcher info by daroberts <daroberts@google.com> - 158883841 Finish adding devsite class to tags in devices/audio by cqn <cqn@google.com> - 158883680 Add devsite class to tags in devices/sensors and devices/... by cqn <cqn@google.com> - 158871012 Improve Jack deprecation warning message. by gdimino <gdimino@google.com> - 158867373 Add devsite classes to tags for devices/graphics by cqn <cqn@google.com> - 158867298 Added devsite classes to tags in devices/input by cqn <cqn@google.com> - 158867192 Add devsite classes to tags in devices/camera and devices... by cqn <cqn@google.com> PiperOrigin-RevId: 159519221 Change-Id: I924de0c1668bcbcc94ee97e60c144aac4c81708d
Diffstat (limited to 'en/devices/tech/debug/asan.html')
-rw-r--r--en/devices/tech/debug/asan.html34
1 files changed, 17 insertions, 17 deletions
diff --git a/en/devices/tech/debug/asan.html b/en/devices/tech/debug/asan.html
index 0ab286dc..353aa4bd 100644
--- a/en/devices/tech/debug/asan.html
+++ b/en/devices/tech/debug/asan.html
@@ -62,7 +62,7 @@ to the build rules. Clang may find bugs in your code that GCC missed.</p>
<p>Add <code>LOCAL_SANITIZE:=address</code> to the build rule of the
executable.</p>
-<pre>
+<pre class="devsite-click-to-copy">
LOCAL_SANITIZE:=address
</pre>
@@ -83,7 +83,7 @@ which are built with ASan, you'll need two copies of the library. The
recommended way to do this is to add the following to <code>Android.mk</code>
for the module in question:</p>
-<pre>
+<pre class="devsite-click-to-copy">
LOCAL_SANITIZE:=address
LOCAL_MODULE_RELATIVE_PATH := asan
</pre>
@@ -95,7 +95,7 @@ LOCAL_MODULE_RELATIVE_PATH := asan
<p>For system daemons, add the following to the appropriate section of
<code>/init.rc</code> or <code>/init.$device$.rc</code>.</p>
-<pre>
+<pre class="devsite-click-to-copy">
setenv LD_LIBRARY_PATH /system/lib/asan
</pre>
@@ -111,9 +111,9 @@ sync</code>.</p>
when present by reading <code>/proc/$PID/maps</code>. If it's not, you may need
to disable SELinux, like so:</p>
-<pre>
-$ adb root
-$ adb shell setenforce 0
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">adb root</code>
+<code class="devsite-terminal">adb shell setenforce 0</code>
# restart the process with adb shell kill $PID
# if it is a system service, or may be adb shell stop; adb shell start.
</pre>
@@ -126,7 +126,7 @@ of Android is built without frame pointers. As a result, you will often get
only one or two meaningful frames. To fix this, either rebuild the library with
ASan (recommended!), or with:</p>
-<pre>
+<pre class="devsite-click-to-copy">
LOCAL_CFLAGS:=-fno-omit-frame-pointer
LOCAL_ARM_MODE:=arm
</pre>
@@ -167,7 +167,7 @@ this). Edit the Zygote record in
<code>system/core/rootdir/init.zygote(<em>32|64</em>).rc</code> to add the
following lines:</p>
-<pre>
+<pre class="devsite-click-to-copy">
setenv LD_LIBRARY_PATH /system/lib/asan:/system/lib
setenv ASAN_OPTIONS
allow_user_segv_handler=true
@@ -186,10 +186,10 @@ trading some memory overhead for slower application startup.</p>
that’s used to run apps under Valgrind. The following example runs the Gmail app
under ASan:</p>
-<pre>
-$ adb root
-$ adb shell setenforce 0 # disable SELinux
-$ adb shell setprop wrap.com.google.android.gm "asanwrapper"
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">adb root</code>
+<code class="devsite-terminal">adb shell setenforce 0 # disable SELinux</code>
+<code class="devsite-terminal">adb shell setprop wrap.com.google.android.gm "asanwrapper"</code>
</pre>
<p>In this context, asanwrapper rewrites <code>/system/bin/app_process</code>
@@ -209,16 +209,16 @@ AddressSanitizer at once.</p>
<p>Run the following commands in the same build tree.</p>
-<pre>
-$ make -j42
-$ SANITIZE_TARGET=address make -j42
+<pre class="devsite-click-to-copy">
+<code class="devsite-terminal">make -j42</code>
+<code class="devsite-terminal">SANITIZE_TARGET=address make -j42</code>
</pre>
<p>In this mode, <code>userdata.img</code> contains extra libraries and must be
flashed to the device as well. Use the following command line:</p>
-<pre>
-$ fastboot flash userdata && fastboot flashall
+<pre class="devsite-terminal devsite-click-to-copy">
+fastboot flash userdata && fastboot flashall
</pre>
<p>At the moment of this writing, modern Nexus and Pixel devices boot to the UI in this mode.</p>