[PATCH] [UBsan] Dumping call stacks when reporting bad-cast (-fsanitize=vptr)

Alexey Samsonov vonosmas at gmail.com
Tue Jul 22 16:39:30 PDT 2014


Once again, sorry for the delay.

================
Comment at: lib/ubsan/ubsan_diag.cc:40
@@ +39,3 @@
+    // symbolizations.
+    if (GetEnv("UBSAN_NO_SYMBOLIZE"))
+      Symbolizer::Init("");
----------------
I'm opposed to this. Instead, you should use the value of "symbolize" flag in sanitizer_common. Probably it's time to introduce UBSAN_OPTIONS similar to another sanitizers. I will take a look at existing code and return with more comments.

================
Comment at: lib/ubsan/ubsan_diag.h:29
@@ +28,3 @@
+  stack.Unwind(MAX_PRINT_STACK_DEPTH, GET_CALLER_PC(), GET_CURRENT_FRAME(),
+               0, 0, 0, false);
+  stack.Print();
----------------
And again, it's better to make use of fast_unwind_on_fatal flag from sanitizer_common.

================
Comment at: lib/ubsan/ubsan_handlers_cxx.cc:71
@@ -62,1 +70,3 @@
 
+  PrintCurrentStack();
+
----------------
It makes sense to hide this feature under a runtime flag.

http://reviews.llvm.org/D4410






More information about the llvm-commits mailing list