[PATCH] Test failures in GCC ASan testsuite on ARM Linux due to FP format mismatch between libsanitizer and GCC.

Alexey Samsonov vonosmas at gmail.com
Wed Aug 20 09:57:31 PDT 2014


================
Comment at: lib/sanitizer_common/sanitizer_stacktrace.cc:47
@@ +46,3 @@
+// pointer to saved frame pointer in any case.
+static uhwptr *GetCanonicFrame(uptr bp, uptr stack_top, uptr stack_bottom) {
+  if (!IsValidFrame(bp, stack_top, stack_bottom))
----------------
Make this inline.

================
Comment at: lib/sanitizer_common/sanitizer_stacktrace.cc:48
@@ +47,3 @@
+static uhwptr *GetCanonicFrame(uptr bp, uptr stack_top, uptr stack_bottom) {
+  if (!IsValidFrame(bp, stack_top, stack_bottom))
+    return 0;
----------------
This check is not needed if we're not on ARM. Can you keep the original behavior on non-ARM platforms?
  #ifdef __arm__
    if (!IsValidFrame(bp, stack_top, stack_bottom) return 0;
    uhwptr *bp_prev = (uhwptr *)bp;
    if (IsValidFrame((uptr)bp_prev[0], stack_top, stack_bottom) return bp_prev;
    return bp_prev - 1;
  #else
    return (uhwptr*)bp;
  #endif


================
Comment at: lib/sanitizer_common/sanitizer_stacktrace.cc:67
@@ -47,2 +66,3 @@
+  uhwptr *prev_frame = 0;
   if (stack_top < 4096) return;  // Sanity check for stack top.
   // Avoid infinite loop when frame == frame[0] by using frame > prev_frame.
----------------
Move this line upper (before calling GetCanonicFrame for the first time).

================
Comment at: test/asan/TestCases/Linux/clang_gcc_abi.cc:40
@@ +39,3 @@
+}
+// CHECK: #1 0x{{.*}} in boom {{.*}}clang_gcc_abi.cc:[[@LINE-28]]
+// CHECK: #2 0x{{.*}} in gcc_abi {{.*}}clang_gcc_abi.cc:[[@LINE-24]]
----------------
Put CHECK-lines closer to the actual source code lines

http://reviews.llvm.org/D4692






More information about the llvm-commits mailing list