summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMitch Phillips <mitchphillips@outlook.com>2019-08-09 19:36:41 +0000
committerMitch Phillips <mitchphillips@outlook.com>2019-08-09 19:36:41 +0000
commit1a2676310787843a375588ffe4e0dbb2846e4d0a (patch)
tree73a1835adaa4943aea4e436e499649493d4078a2 /test
parent6268708e53727a106cda959a3d7b0b8fafdb2b5c (diff)
downloadcompiler-rt-1a2676310787843a375588ffe4e0dbb2846e4d0a.tar.gz
Revert "[asan_symbolize] Fix bug where the frame counter was not incremented."
This reverts commit 52a36fae2a3f8560a5be690a67304db5edafc3fe. This commit broke the sanitizer_android buildbot. See comments at https://reviews.llvm.org/rL368373 for more details. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cpp48
-rw-r--r--test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.py31
2 files changed, 0 insertions, 79 deletions
diff --git a/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cpp b/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cpp
deleted file mode 100644
index d4450d35b..000000000
--- a/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-// This test case checks for an old bug when using plug-ins that caused
-// the stack numbering to be incorrect.
-
-// RUN: %clangxx_asan -O0 -g %s -o %t
-// RUN: %env_asan_opts=symbolize=0 not %run %t DUMMY_ARG > %t.asan_report 2>&1
-// RUN: %asan_symbolize --log-level debug --log-dest %t_debug_log_output.txt -l %t.asan_report --plugins %S/plugin_wrong_frame_number_bug.py > %t.asan_report_sym
-// RUN: FileCheck --input-file=%t.asan_report_sym %s
-
-#include <stdlib.h>
-
-int* p;
-extern "C" {
-
-void bug() {
- free(p);
-}
-
-void foo(bool call_bug) {
- if (call_bug)
- bug();
-}
-
-// This indirection exists so that the call stack
-// is reliably large enough.
-void do_access_impl() {
- *p = 42;
-}
-
-void do_access() {
- do_access_impl();
-}
-
-int main(int argc, char** argv) {
- p = (int*) malloc(sizeof(p));
- foo(argc > 1);
- do_access();
- free(p);
- return 0;
-}
-}
-
-// Check that the numbering of the stackframes is correct.
-
-// CHECK: AddressSanitizer: heap-use-after-free
-// CHECK-NEXT: WRITE of size
-// CHECK-NEXT: #0 0x{{[0-9a-fA-F]+}}
-// CHECK-NEXT: #1 0x{{[0-9a-fA-F]+}} in do_access
-// CHECK-NEXT: #2 0x{{[0-9a-fA-F]+}} in main
diff --git a/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.py b/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.py
deleted file mode 100644
index 455120281..000000000
--- a/test/asan/TestCases/Posix/asan_symbolize_script/plugin_wrong_frame_number_bug.py
+++ /dev/null
@@ -1,31 +0,0 @@
-import logging
-
-class FailOncePlugin(AsanSymbolizerPlugIn):
- """
- This is a simple plug-in that always claims
- that a binary can't be symbolized on the first
- call but succeeds for all subsequent calls.
-
- This plug-in exists to reproduce an old bug
- in the `asan_symbolize.py` script.
-
- By failing the first symbolization request
- we used to cause an early exit in `asan_symbolize.py`
- that didn't increment the frame counter which
- caused subsequent symbolization attempts to
- print the wrong frame number.
- """
- def __init__(self):
- self.should_fail = True
- pass
-
- def filter_binary_path(self, path):
- logging.info('filter_binary_path called in NoOpPlugin')
- if self.should_fail:
- logging.info('Doing first fail')
- self.should_fail = False
- return None
- logging.info('Doing succeed')
- return path
-
-register_plugin(FailOncePlugin())