Commit 5b66b829 authored by Jacob Dufault's avatar Jacob Dufault Committed by Commit Bot

Update asan docs.

Change-Id: I1abf5400e9c3dea53d22e6c0142887d37ca5e5e3
Reviewed-on: https://chromium-review.googlesource.com/1115429
Commit-Queue: Jacob Dufault <jdufault@chromium.org>
Reviewed-by: default avatarSteven Bennetts <stevenjb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#570855}
parent adaa7a57
# Running Chrome tests with AddressSanitizer (asan) and LeakSanitizer (lsan) # Running Chrome tests with AddressSanitizer (asan) and LeakSanitizer (lsan)
It is relatively straightforward to run asan/lsan tests. The only tricky part Running asan/lsan tests requires changing the build and setting a few
is that some environment variables need to be set. environment variables.
Changes to args.gn (ie, `out/Release/args.gn`): Changes to args.gn (ie, `out/Release/args.gn`):
...@@ -10,10 +10,17 @@ is_asan = true ...@@ -10,10 +10,17 @@ is_asan = true
is_lsan = true is_lsan = true
``` ```
How to run the test: Setting up environment variables and running the test:
```sh ```sh
$ export ASAN_OPTIONS="symbolize=1 external_symbolizer_path=./third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer detect_leaks=1 detect_odr_violation=0" $ export ASAN_OPTIONS="symbolize=1 external_symbolizer_path=./third_party/llvm-build/Release+Asserts/bin/llvm-symbolizer detect_leaks=1 detect_odr_violation=0"
$ export LSAN_OPTIONS="" $ export LSAN_OPTIONS=""
$ out/Release/browser_tests $ out/Release/browser_tests
``` ```
Stack traces (such as those emitted by `base::debug::StackTrace().Print()`) may
not be fully symbolized. The following snippet can symbolize them:
```sh
$ out/Release/browser_tests 2>&1 | ./tools/valgrind/asan/asan_symbolize.py
```
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment