llvm-project/compiler-rt/lib/asan
Dan Liew c3b93bed29 [asan_symbolize] Fix bug where the frame counter was not incremented.
Summary:
This bug occurred when a plug-in requested that a binary not be
symbolized while the script is trying to symbolize a stack frame. In
this case `self.frame_no` would not be incremented. This would cause
subsequent stack frames that are symbolized to be incorrectly numbered.

To fix this `get_symbolized_lines()` has been modified to take an
argument that indicates whether the stack frame counter should
incremented. In `process_line_posix()` `get_symbolized_lines(None, ...)`
is now used in in the case where we don't want to symbolize a line so
that we can keep the frame counter increment in a single function.

A test case is included. The test uses a dummy plugin that always asks
`asan_symbolize.py` script to not symbolize the first binary that the
script asks about. Prior to the patch this would cause the output to
script to look something like

```
  #0 0x0
  #0 0x0 in do_access
  #1 0x0 in main
```

This is the second attempt at landing this patch. The first (r368373)
failed due to failing some android bots and so was reverted in r368472.
The new test is now disabled for Android. It turns out that the patch
also fails for iOS too so it is also disabled for that family of
platforms too.

rdar://problem/49476995

Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

Differential Revision: https://reviews.llvm.org/D65495

llvm-svn: 368603
2019-08-12 18:51:25 +00:00
..
scripts [asan_symbolize] Fix bug where the frame counter was not incremented. 2019-08-12 18:51:25 +00:00
tests compiler-rt: Rename cc files below test/asan to cpp 2019-08-05 16:48:12 +00:00
.clang-format [sanitizer] Remove unneeded blank lines 2018-05-09 00:44:26 +00:00
CMakeLists.txt compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
README.txt [ASan] Fix the links to bugs and wikipages. 2015-12-04 17:37:40 +00:00
asan.syms.extra [asan] Export __sancov_* symbols symbols. 2017-01-31 20:23:07 +00:00
asan_activation.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_activation.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_activation_flags.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_allocator.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_allocator.h compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_blacklist.txt
asan_debugging.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_descriptions.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_descriptions.h compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_errors.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_errors.h [asan] clang-format parent patch 2019-05-21 20:24:42 +00:00
asan_fake_stack.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_fake_stack.h compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_flags.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_flags.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_flags.inc [sanitizers][windows] Rtl-Heap Interception and tests 2019-07-09 01:47:08 +00:00
asan_fuchsia.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_globals.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_globals_win.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_init_version.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_interceptors.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_interceptors.h compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_interceptors_memintrinsics.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_interceptors_memintrinsics.h Remove a few straggler ".cc"s in compiler-rt/lib 2019-08-01 17:53:25 +00:00
asan_interceptors_vfork.S [hwasan, asan] Intercept vfork. 2019-02-27 21:11:50 +00:00
asan_interface.inc [hwasan, asan] Intercept vfork. 2019-02-27 21:11:50 +00:00
asan_interface_internal.h [hwasan, asan] Intercept vfork. 2019-02-27 21:11:50 +00:00
asan_internal.h compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_linux.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_lock.h
asan_mac.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_malloc_linux.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_malloc_local.h [asan] Fix debug asan build link error 2019-05-22 20:29:12 +00:00
asan_malloc_mac.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_malloc_win.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_mapping.h [ASan] Use dynamic shadow on 32-bit iOS and simulators 2019-06-21 21:01:39 +00:00
asan_mapping_myriad.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_mapping_sparc64.h AddressSanitizer: 64-bit SPARC/Linux port 2019-03-12 21:02:24 +00:00
asan_memory_profile.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_new_delete.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_poisoning.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_poisoning.h [ASan] Use __sanitizer_fill_shadow for FastPoisonShadow on Fuchsia 2019-07-11 07:30:11 +00:00
asan_posix.cpp Restrict the NetBSD ASan TSD fallback to !ASAN_DYNAMIC 2019-08-07 21:56:43 +00:00
asan_preinit.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_premap_shadow.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_premap_shadow.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_report.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_report.h [sanitizer] Implement reallocarray. 2019-05-01 17:33:01 +00:00
asan_rtems.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_rtl.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_scariness_score.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_shadow_setup.cpp [Sanitizer] Linux refactor shadow huge page mode handling 2019-08-05 20:54:36 +00:00
asan_stack.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_stack.h compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_stats.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_stats.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan_suppressions.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_suppressions.h compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_thread.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_thread.h compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_win.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_win_dll_thunk.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_win_dynamic_runtime_thunk.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
asan_win_weak_interception.cpp compiler-rt: Rename .cc file in lib/asan to .cpp 2019-08-01 13:43:28 +00:00
weak_symbols.txt Add lsan interceptors for libdispatch functions on darwin 2017-06-19 19:21:31 +00:00

README.txt

AddressSanitizer RT
================================
This directory contains sources of the AddressSanitizer (ASan) runtime library.

Directory structure:
README.txt       : This file.
Makefile.mk      : File for make-based build.
CMakeLists.txt   : File for cmake-based build.
asan_*.{cc,h}    : Sources of the asan runtime library.
scripts/*        : Helper scripts.
tests/*          : ASan unit tests.

Also ASan runtime needs the following libraries:
lib/interception/      : Machinery used to intercept function calls.
lib/sanitizer_common/  : Code shared between various sanitizers.

ASan runtime currently also embeds part of LeakSanitizer runtime for
leak detection (lib/lsan/lsan_common.{cc,h}).

ASan runtime can only be built by CMake. You can run ASan tests
from the root of your CMake build tree:

make check-asan

For more instructions see:
https://github.com/google/sanitizers/wiki/AddressSanitizerHowToBuild