[PATCH] [msan] -fsanitize-memory-track-origins=[level] flag and docs.

Alexey Samsonov samsonov at google.com
Thu Mar 20 02:21:01 PDT 2014



================
Comment at: docs/MemorySanitizer.rst:153
@@ +152,3 @@
+    % ./a.out 2>log
+    % projects/compiler-rt/lib/asan/scripts/asan_symbolize.py / < log | c++filt
+    WARNING: MemorySanitizer: use-of-uninitialized-value
----------------
Can you please get rid of asan_symbolize.py in MSan docs? Use either MSAN_SYMBOLIZER_PATH, or note that it's enough to have llvm-symbolizer in your PATH.

================
Comment at: docs/UsersManual.rst:977
@@ -976,1 +976,3 @@
 
+      Possible values for level are 0, 1 (default), 2. Level 2 adds several more
+      sections to MemorySanitizer reports describing the order of memory stores
----------------
0 (off)
s/several //

================
Comment at: include/clang/Driver/Options.td:498
@@ -496,1 +497,3 @@
+                                     Alias<fsanitize_memory_track_origins_EQ>, AliasArgs<["1"]>;
 def fno_sanitize_memory_track_origins : Flag<["-"], "fno-sanitize-memory-track-origins">,
+                                        Alias<fsanitize_memory_track_origins_EQ>, AliasArgs<["0"]>;
----------------
Maybe we can just kill this flag?

================
Comment at: lib/Driver/SanitizerArgs.cpp:172
@@ +171,3 @@
+      if (S.getAsInteger(0, MsanTrackOrigins) || MsanTrackOrigins < 0 ||
+          MsanTrackOrigins > 2)
+        D.Diag(diag::err_drv_invalid_value)
----------------
Use {} here

================
Comment at: lib/Driver/SanitizerArgs.cpp:166
@@ -164,2 +165,3 @@
 
   // Parse -f(no-)sanitize-memory-track-origins options.
+  if (NeedsMsan) {
----------------
Fix a comment

================
Comment at: test/Driver/fsanitize.c:78
@@ -77,3 +77,3 @@
 // RUN: %clang -target x86_64-linux-gnu -fsanitize-memory-track-origins -pie %s -### 2>&1 | FileCheck %s --check-prefix=CHECK-ONLY-TRACK-ORIGINS
-// CHECK-ONLY-TRACK-ORIGINS: warning: argument unused during compilation: '-fsanitize-memory-track-origins'
+// CHECK-ONLY-TRACK-ORIGINS: warning: argument unused during compilation: '-fsanitize-memory-track-origins=1'
 
----------------
This is confusing. We should try to print the flag the user has provided in command line.


http://llvm-reviews.chandlerc.com/D3118



More information about the cfe-commits mailing list