You've already forked linux-packaging-mono
acceptance-tests
data
debian
docs
external
Newtonsoft.Json
api-doc-tools
api-snapshot
aspnetwebstack
bdwgc
binary-reference-assemblies
bockbuild
boringssl
cecil
cecil-legacy
corefx
corert
helix-binaries
ikdasm
ikvm
illinker-test-assets
linker
llvm-project
clang
clang-tools-extra
compiler-rt
cmake
docs
include
lib
BlocksRuntime
asan
scripts
tests
CMakeLists.txt
asan_asm_test.cc
asan_benchmarks_test.cc
asan_exceptions_test.cc
asan_fake_stack_test.cc
asan_globals_test.cc
asan_interface_test.cc
asan_internal_interface_test.cc
asan_mac_test.cc
asan_mac_test.h
asan_mac_test_helpers.mm
asan_mem_test.cc
asan_noinst_test.cc
asan_oob_test.cc
asan_racy_double_free_test.cc
asan_str_test.cc
asan_test.cc
asan_test.ignore
asan_test_config.h
asan_test_main.cc
asan_test_utils.h
.clang-format
CMakeLists.txt
README.txt
asan.syms.extra
asan_activation.cc
asan_activation.h
asan_activation_flags.inc
asan_allocator.cc
asan_allocator.h
asan_blacklist.txt
asan_debugging.cc
asan_descriptions.cc
asan_descriptions.h
asan_errors.cc
asan_errors.h
asan_fake_stack.cc
asan_fake_stack.h
asan_flags.cc
asan_flags.h
asan_flags.inc
asan_fuchsia.cc
asan_globals.cc
asan_globals_win.cc
asan_init_version.h
asan_interceptors.cc
asan_interceptors.h
asan_interceptors_memintrinsics.cc
asan_interceptors_memintrinsics.h
asan_interface.inc
asan_interface_internal.h
asan_internal.h
asan_linux.cc
asan_lock.h
asan_mac.cc
asan_malloc_linux.cc
asan_malloc_mac.cc
asan_malloc_win.cc
asan_mapping.h
asan_memory_profile.cc
asan_new_delete.cc
asan_poisoning.cc
asan_poisoning.h
asan_posix.cc
asan_preinit.cc
asan_premap_shadow.cc
asan_premap_shadow.h
asan_report.cc
asan_report.h
asan_rtl.cc
asan_scariness_score.h
asan_shadow_setup.cc
asan_stack.cc
asan_stack.h
asan_stats.cc
asan_stats.h
asan_suppressions.cc
asan_suppressions.h
asan_thread.cc
asan_thread.h
asan_win.cc
asan_win_dll_thunk.cc
asan_win_dynamic_runtime_thunk.cc
asan_win_weak_interception.cc
weak_symbols.txt
builtins
cfi
dfsan
esan
fuzzer
hwasan
interception
lsan
msan
profile
safestack
sanitizer_common
scudo
stats
tsan
ubsan
ubsan_minimal
xray
CMakeLists.txt
test
unittests
www
.arcconfig
.gitignore
CMakeLists.txt
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt
libcxx
libcxxabi
libunwind
lld
lldb
llvm
openmp
polly
nuget-buildtasks
nunit-lite
roslyn-binaries
rx
xunit-binaries
how-to-bump-roslyn-binaries.md
ikvm-native
llvm
m4
man
mcs
mono
msvc
netcore
po
runtime
samples
scripts
support
tools
COPYING.LIB
LICENSE
Makefile.am
Makefile.in
NEWS
README.md
acinclude.m4
aclocal.m4
autogen.sh
code_of_conduct.md
compile
config.guess
config.h.in
config.rpath
config.sub
configure.REMOVED.git-id
configure.ac.REMOVED.git-id
depcomp
install-sh
ltmain.sh.REMOVED.git-id
missing
mkinstalldirs
mono-uninstalled.pc.in
test-driver
winconfig.h
110 lines
2.7 KiB
C
110 lines
2.7 KiB
C
![]() |
//===-- asan_test_utils.h ---------------------------------------*- C++ -*-===//
|
||
|
//
|
||
|
// The LLVM Compiler Infrastructure
|
||
|
//
|
||
|
// This file is distributed under the University of Illinois Open Source
|
||
|
// License. See LICENSE.TXT for details.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
//
|
||
|
// This file is a part of AddressSanitizer, an address sanity checker.
|
||
|
//
|
||
|
//===----------------------------------------------------------------------===//
|
||
|
|
||
|
#ifndef ASAN_TEST_UTILS_H
|
||
|
#define ASAN_TEST_UTILS_H
|
||
|
|
||
|
#if !defined(SANITIZER_EXTERNAL_TEST_CONFIG)
|
||
|
# define INCLUDED_FROM_ASAN_TEST_UTILS_H
|
||
|
# include "asan_test_config.h"
|
||
|
# undef INCLUDED_FROM_ASAN_TEST_UTILS_H
|
||
|
#endif
|
||
|
|
||
|
#include "sanitizer_test_utils.h"
|
||
|
#include "sanitizer_pthread_wrappers.h"
|
||
|
|
||
|
#include <stdio.h>
|
||
|
#include <signal.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <string.h>
|
||
|
#include <stdint.h>
|
||
|
#include <assert.h>
|
||
|
#include <algorithm>
|
||
|
#include <setjmp.h>
|
||
|
|
||
|
#if !defined(_WIN32)
|
||
|
# include <strings.h>
|
||
|
# include <sys/mman.h>
|
||
|
#endif
|
||
|
|
||
|
#ifdef __linux__
|
||
|
# include <sys/prctl.h>
|
||
|
# include <sys/types.h>
|
||
|
# include <sys/stat.h>
|
||
|
# include <fcntl.h>
|
||
|
#include <unistd.h>
|
||
|
#endif
|
||
|
|
||
|
#if !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__NetBSD__)
|
||
|
#include <malloc.h>
|
||
|
#endif
|
||
|
|
||
|
#if ASAN_HAS_EXCEPTIONS
|
||
|
# define ASAN_THROW(x) throw (x)
|
||
|
#else
|
||
|
# define ASAN_THROW(x)
|
||
|
#endif
|
||
|
|
||
|
typedef uint8_t U1;
|
||
|
typedef uint16_t U2;
|
||
|
typedef uint32_t U4;
|
||
|
typedef uint64_t U8;
|
||
|
|
||
|
static const int kPageSize = 4096;
|
||
|
|
||
|
// Big enough to be handled by secondary allocator and small enough to fit into
|
||
|
// quarantine for all configurations.
|
||
|
const size_t kLargeMalloc = 1 << 22;
|
||
|
|
||
|
extern void free_aaa(void *p);
|
||
|
extern void *malloc_aaa(size_t size);
|
||
|
|
||
|
template<typename T>
|
||
|
NOINLINE void asan_write(T *a) {
|
||
|
*a = 0;
|
||
|
}
|
||
|
|
||
|
string RightOOBErrorMessage(int oob_distance, bool is_write);
|
||
|
string RightOOBWriteMessage(int oob_distance);
|
||
|
string RightOOBReadMessage(int oob_distance);
|
||
|
string LeftOOBErrorMessage(int oob_distance, bool is_write);
|
||
|
string LeftOOBWriteMessage(int oob_distance);
|
||
|
string LeftOOBReadMessage(int oob_distance);
|
||
|
string LeftOOBAccessMessage(int oob_distance);
|
||
|
char* MallocAndMemsetString(size_t size, char ch);
|
||
|
char* MallocAndMemsetString(size_t size);
|
||
|
|
||
|
extern char glob1[1];
|
||
|
extern char glob2[2];
|
||
|
extern char glob3[3];
|
||
|
extern char glob4[4];
|
||
|
extern char glob5[5];
|
||
|
extern char glob6[6];
|
||
|
extern char glob7[7];
|
||
|
extern char glob8[8];
|
||
|
extern char glob9[9];
|
||
|
extern char glob10[10];
|
||
|
extern char glob11[11];
|
||
|
extern char glob12[12];
|
||
|
extern char glob13[13];
|
||
|
extern char glob14[14];
|
||
|
extern char glob15[15];
|
||
|
extern char glob16[16];
|
||
|
extern char glob17[17];
|
||
|
extern char glob1000[1000];
|
||
|
extern char glob10000[10000];
|
||
|
extern char glob100000[100000];
|
||
|
extern int GlobalsTest(int x);
|
||
|
|
||
|
#endif // ASAN_TEST_UTILS_H
|