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

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: Addressed comments and added error testing 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..eed2916314a0dfa65b2392a8b988e80396112bed 100644
--- a/docs/ASAN.rst
+++ b/docs/ASAN.rst
@@ -10,14 +10,21 @@ 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 some calls to calloc(),
+even with inlining turned off, so we provide wrapper scripts,
+sz-clang.py and sz-clang++.py, that normally just pass their arguments
+through to pnacl-clang or pnacl-clang++, but add instrumentation to
+replace calls to calloc() at the source level if they are 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
Karl 2016/07/14 20:36:29 Silly question: Should you add -fno-inline if -fsa
tlively 2016/07/15 01:54:24 Done.
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