[Lldb-commits] [PATCH] D27017: Support more report types in AddressSanitizerRuntime.cpp

Kuba Brecka via lldb-commits lldb-commits at lists.llvm.org
Tue Nov 22 16:48:23 PST 2016


kubabrecka created this revision.
kubabrecka added reviewers: clayborg, jasonmolenda, jingham.
kubabrecka added subscribers: lldb-commits, zaks.anna.
kubabrecka set the repository for this revision to rL LLVM.
kubabrecka added a project: Sanitizers.

https://reviews.llvm.org/D27012 will add more report types into ASan that will be reported via the debugging API.  This patch in LLDB provides human-friendly bug descriptions.


Repository:
  rL LLVM

https://reviews.llvm.org/D27017

Files:
  source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp


Index: source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
===================================================================
--- source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
+++ source/Plugins/InstrumentationRuntime/AddressSanitizer/AddressSanitizerRuntime.cpp
@@ -216,10 +216,46 @@
     return "Global buffer overflow detected";
   } else if (description == "unknown-crash") {
     return "Invalid memory access detected";
+  } else if (description == "stack-overflow") {
+    return "Stack overflow detected (recursion too deep)";
+  } else if (description == "null-deref") {
+    return "Null pointer dereference detected";
+  } else if (description == "wild-jump") {
+    return "Wild pointer jump detected";
+  } else if (description == "wild-addr-write") {
+    return "Write to a wild pointer detected";
+  } else if (description == "wild-addr-read") {
+    return "Read from a wild pointer detected";
+  } else if (description == "wild-addr") {
+    return "Access to a wild pointer detected";
+  } else if (description == "signal") {
+    return "Deadly signal detected";
+  } else if (description == "double-free") {
+    return "Attempt to deallocate a freed object detected";
+  } else if (description == "new-delete-type-mismatch") {
+    return "Deallocation of a wrong size detected";
+  } else if (description == "bad-free") {
+    return "Attempt to free a non-allocated address detected";
+  } else if (description == "alloc-dealloc-mismatch") {
+    return "Mismatch between allocation and deallocation APIs detected";
+  } else if (description == "bad-malloc_usable_size") {
+    return "Invalid call to malloc_usable_size detected";
+  } else if (description == "bad-__sanitizer_get_allocated_size") {
+    return "Invalid call to __sanitizer_get_allocated_size detected";
+  } else if (description == "param-overlap") {
+    return "Overlapping memory ranges detected";
+  } else if (description == "negative-size-param") {
+    return "Negative size memory access detected";
+  } else if (description == "bad-__sanitizer_annotate_contiguous_container") {
+    return "Invalid call to __sanitizer_annotate_contiguous_container detected";
+  } else if (description == "odr-violation") {
+    return "Initialization order problem detected";
+  } else if (description == "invalid-pointer-pair") {
+    return "Invalid pointer pair in arithmetic operation detected";
   }
 
   // for unknown report codes just show the code
-  return description;
+  return "AddressSanitizer detected: " + description;
 }
 
 bool AddressSanitizerRuntime::NotifyBreakpointHit(


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27017.78979.patch
Type: text/x-patch
Size: 2648 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20161123/d2cb9e46/attachment.bin>


More information about the lldb-commits mailing list