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

Unified Diff: docs/ASAN.rst

Issue 2145213002: Subzero: implemented wrapper script to replace calls to calloc() (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Updated command examples Created 4 years, 5 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 | pydir/sz-clang.py » ('j') | pydir/sz-clang.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: docs/ASAN.rst
diff --git a/docs/ASAN.rst b/docs/ASAN.rst
index d815817c042656f9f56fb4df35bb1a1629ea4872..0c556c82ab106ad93d5f3ca8dd6bbc682a37e608 100644
--- a/docs/ASAN.rst
+++ b/docs/ASAN.rst
@@ -10,14 +10,20 @@ used in production.
In Subzero, AddressSanitizer depends on being able to find and instrument calls
to various functions such as malloc() and free(), and as such the .pexe file
-being translated must not have had those symbols stripped. Subzero will not
-complain if it is told to translate a .pexe file with its symbols stripped, but
-it will not be able to find calls to malloc() and free(), so AddressSanitizer
-will not work correctly in the final executable.
+being translated must not have had those symbols stripped or inlined. Subzero
+will not complain if it is told to translate a .pexe file with its symbols
+stripped, but it will not be able to find calls to malloc(), calloc(), free(),
+etc., so AddressSanitizer will not work correctly in the final executable.
+
+Furthermore, pnacl-clang automatically inlines calls to calloc(), even with
Karl 2016/07/14 17:33:50 s/calls/some calls/? Do you know it does this to
tlively 2016/07/14 20:26:14 Done.
+inlining turned off, so we provide a wrapper script, sz-clang.py, that normally
+just passes its arguments through to pnacl-clang, but adds instrumentation to
+replace calls to calloc() at the source level if it is passed
+-fsanitize-address.
These are the steps to compile hello.c to an instrumented object file::
- pnacl-clang -o hello.nonfinal.pexe hello.c
+ sz-clang.py -fno-inline -fsanitize-address -o hello.nonfinal.pexe hello.c
pnacl-finalize --no-strip-syms -o hello.pexe hello.nonfinal.pexe
pnacl-sz -fsanitize-address -filetype=obj -o hello.o hello.pexe
« no previous file with comments | « no previous file | pydir/sz-clang.py » ('j') | pydir/sz-clang.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698