2012-11-23 06:03:11 +08:00
|
|
|
//===-- tsan_defs.h ---------------------------------------------*- C++ -*-===//
|
|
|
|
//
|
2019-08-14 16:47:11 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2012-11-23 06:03:11 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file is a part of ThreadSanitizer (TSan), a race detector.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#ifndef TSAN_DEFS_H
|
|
|
|
#define TSAN_DEFS_H
|
|
|
|
|
|
|
|
#include "sanitizer_common/sanitizer_internal_defs.h"
|
|
|
|
#include "sanitizer_common/sanitizer_libc.h"
|
2021-09-28 01:43:33 +08:00
|
|
|
#include "sanitizer_common/sanitizer_mutex.h"
|
2015-10-21 15:32:45 +08:00
|
|
|
#include "ubsan/ubsan_platform.h"
|
2012-11-23 06:03:11 +08:00
|
|
|
|
2021-09-28 01:43:33 +08:00
|
|
|
#ifndef TSAN_VECTORIZE
|
|
|
|
# define TSAN_VECTORIZE __SSE4_2__
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if TSAN_VECTORIZE
|
|
|
|
// <emmintrin.h> transitively includes <stdlib.h>,
|
|
|
|
// and it's prohibited to include std headers into tsan runtime.
|
|
|
|
// So we do this dirty trick.
|
|
|
|
# define _MM_MALLOC_H_INCLUDED
|
|
|
|
# define __MM_MALLOC_H
|
|
|
|
# include <emmintrin.h>
|
|
|
|
# include <smmintrin.h>
|
|
|
|
# define VECTOR_ALIGNED ALIGNED(16)
|
|
|
|
typedef __m128i m128;
|
|
|
|
#else
|
|
|
|
# define VECTOR_ALIGNED
|
|
|
|
#endif
|
|
|
|
|
2015-10-21 15:32:45 +08:00
|
|
|
// Setup defaults for compile definitions.
|
|
|
|
#ifndef TSAN_NO_HISTORY
|
|
|
|
# define TSAN_NO_HISTORY 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef TSAN_CONTAINS_UBSAN
|
2016-11-09 06:04:09 +08:00
|
|
|
# if CAN_SANITIZE_UB && !SANITIZER_GO
|
|
|
|
# define TSAN_CONTAINS_UBSAN 1
|
|
|
|
# else
|
|
|
|
# define TSAN_CONTAINS_UBSAN 0
|
|
|
|
# endif
|
2015-10-21 15:32:45 +08:00
|
|
|
#endif
|
2012-11-23 06:03:11 +08:00
|
|
|
|
|
|
|
namespace __tsan {
|
|
|
|
|
2021-09-28 01:43:33 +08:00
|
|
|
constexpr uptr kByteBits = 8;
|
|
|
|
|
|
|
|
// Thread slot ID.
|
|
|
|
enum class Sid : u8 {};
|
|
|
|
constexpr uptr kThreadSlotCount = 256;
|
|
|
|
constexpr Sid kFreeSid = static_cast<Sid>(255);
|
|
|
|
|
|
|
|
// Abstract time unit, vector clock element.
|
|
|
|
enum class Epoch : u16 {};
|
|
|
|
constexpr uptr kEpochBits = 14;
|
|
|
|
constexpr Epoch kEpochZero = static_cast<Epoch>(0);
|
|
|
|
constexpr Epoch kEpochOver = static_cast<Epoch>(1 << kEpochBits);
|
|
|
|
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 19:23:59 +08:00
|
|
|
const int kClkBits = 42;
|
|
|
|
const unsigned kMaxTidReuse = (1 << (64 - kClkBits)) - 1;
|
|
|
|
|
|
|
|
struct ClockElem {
|
|
|
|
u64 epoch : kClkBits;
|
|
|
|
u64 reused : 64 - kClkBits; // tid reuse count
|
|
|
|
};
|
|
|
|
|
|
|
|
struct ClockBlock {
|
|
|
|
static const uptr kSize = 512;
|
|
|
|
static const uptr kTableSize = kSize / sizeof(u32);
|
|
|
|
static const uptr kClockCount = kSize / sizeof(ClockElem);
|
|
|
|
static const uptr kRefIdx = kTableSize - 1;
|
|
|
|
static const uptr kBlockIdx = kTableSize - 2;
|
|
|
|
|
|
|
|
union {
|
|
|
|
u32 table[kTableSize];
|
|
|
|
ClockElem clock[kClockCount];
|
|
|
|
};
|
|
|
|
|
|
|
|
ClockBlock() {
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2012-11-23 06:03:11 +08:00
|
|
|
const int kTidBits = 13;
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 19:23:59 +08:00
|
|
|
// Reduce kMaxTid by kClockCount because one slot in ClockBlock table is
|
|
|
|
// occupied by reference counter, so total number of elements we can store
|
|
|
|
// in SyncClock is kClockCount * (kTableSize - 1).
|
|
|
|
const unsigned kMaxTid = (1 << kTidBits) - ClockBlock::kClockCount;
|
2016-11-09 06:04:09 +08:00
|
|
|
#if !SANITIZER_GO
|
2012-11-23 06:03:11 +08:00
|
|
|
const unsigned kMaxTidInClock = kMaxTid * 2; // This includes msb 'freed' bit.
|
2015-10-21 15:32:45 +08:00
|
|
|
#else
|
|
|
|
const unsigned kMaxTidInClock = kMaxTid; // Go does not track freed memory.
|
|
|
|
#endif
|
2013-12-05 17:18:38 +08:00
|
|
|
const uptr kShadowStackSize = 64 * 1024;
|
2012-11-23 06:03:11 +08:00
|
|
|
|
|
|
|
// Count of shadow values in a shadow cell.
|
2012-11-23 22:46:25 +08:00
|
|
|
const uptr kShadowCnt = 4;
|
2012-11-23 06:03:11 +08:00
|
|
|
|
|
|
|
// That many user bytes are mapped onto a single shadow cell.
|
2012-11-23 22:46:25 +08:00
|
|
|
const uptr kShadowCell = 8;
|
2012-11-23 06:03:11 +08:00
|
|
|
|
2021-09-28 01:43:33 +08:00
|
|
|
// Single shadow value.
|
|
|
|
typedef u64 RawShadow;
|
|
|
|
const uptr kShadowSize = sizeof(RawShadow);
|
2012-11-23 22:46:25 +08:00
|
|
|
|
|
|
|
// Shadow memory is kShadowMultiplier times larger than user memory.
|
|
|
|
const uptr kShadowMultiplier = kShadowSize * kShadowCnt / kShadowCell;
|
2012-11-23 06:03:11 +08:00
|
|
|
|
2014-09-24 01:59:53 +08:00
|
|
|
// That many user bytes are mapped onto a single meta shadow cell.
|
|
|
|
// Must be less or equal to minimal memory allocator alignment.
|
|
|
|
const uptr kMetaShadowCell = 8;
|
|
|
|
|
|
|
|
// Size of a single meta shadow value (u32).
|
|
|
|
const uptr kMetaShadowSize = 4;
|
|
|
|
|
2021-09-28 01:43:33 +08:00
|
|
|
// All addresses and PCs are assumed to be compressable to that many bits.
|
|
|
|
const uptr kCompressedAddrBits = 44;
|
|
|
|
|
2015-10-21 15:32:45 +08:00
|
|
|
#if TSAN_NO_HISTORY
|
2014-05-22 15:09:21 +08:00
|
|
|
const bool kCollectHistory = false;
|
|
|
|
#else
|
|
|
|
const bool kCollectHistory = true;
|
|
|
|
#endif
|
|
|
|
|
2012-11-23 06:03:11 +08:00
|
|
|
// The following "build consistency" machinery ensures that all source files
|
|
|
|
// are built in the same configuration. Inconsistent builds lead to
|
|
|
|
// hard to debug crashes.
|
2015-10-21 15:32:45 +08:00
|
|
|
#if SANITIZER_DEBUG
|
2012-11-23 06:03:11 +08:00
|
|
|
void build_consistency_debug();
|
|
|
|
#else
|
|
|
|
void build_consistency_release();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
static inline void USED build_consistency() {
|
2015-10-21 15:32:45 +08:00
|
|
|
#if SANITIZER_DEBUG
|
2012-11-23 06:03:11 +08:00
|
|
|
build_consistency_debug();
|
|
|
|
#else
|
|
|
|
build_consistency_release();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
T min(T a, T b) {
|
|
|
|
return a < b ? a : b;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
T max(T a, T b) {
|
|
|
|
return a > b ? a : b;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<typename T>
|
2012-12-05 21:19:55 +08:00
|
|
|
T RoundUp(T p, u64 align) {
|
2012-11-23 06:03:11 +08:00
|
|
|
DCHECK_EQ(align & (align - 1), 0);
|
|
|
|
return (T)(((u64)p + align - 1) & ~(align - 1));
|
|
|
|
}
|
|
|
|
|
2012-12-05 21:19:55 +08:00
|
|
|
template<typename T>
|
|
|
|
T RoundDown(T p, u64 align) {
|
|
|
|
DCHECK_EQ(align & (align - 1), 0);
|
|
|
|
return (T)((u64)p & ~(align - 1));
|
|
|
|
}
|
|
|
|
|
2013-01-10 20:44:08 +08:00
|
|
|
// Zeroizes high part, returns 'bits' lsb bits.
|
|
|
|
template<typename T>
|
|
|
|
T GetLsb(T v, int bits) {
|
|
|
|
return (T)((u64)v & ((1ull << bits) - 1));
|
|
|
|
}
|
|
|
|
|
2012-11-23 06:03:11 +08:00
|
|
|
struct MD5Hash {
|
|
|
|
u64 hash[2];
|
|
|
|
bool operator==(const MD5Hash &other) const;
|
|
|
|
};
|
|
|
|
|
|
|
|
MD5Hash md5_hash(const void *data, uptr size);
|
|
|
|
|
2016-11-09 06:04:09 +08:00
|
|
|
struct Processor;
|
2012-11-23 06:03:11 +08:00
|
|
|
struct ThreadState;
|
2013-12-05 17:18:38 +08:00
|
|
|
class ThreadContext;
|
2012-11-23 06:03:11 +08:00
|
|
|
struct Context;
|
|
|
|
struct ReportStack;
|
|
|
|
class ReportDesc;
|
|
|
|
class RegionAlloc;
|
2014-09-24 01:59:53 +08:00
|
|
|
|
2021-09-28 01:43:33 +08:00
|
|
|
typedef uptr AccessType;
|
|
|
|
|
|
|
|
enum : AccessType {
|
|
|
|
kAccessWrite = 0,
|
|
|
|
kAccessRead = 1 << 0,
|
|
|
|
kAccessAtomic = 1 << 1,
|
|
|
|
kAccessVptr = 1 << 2, // read or write of an object virtual table pointer
|
|
|
|
kAccessFree = 1 << 3, // synthetic memory access during memory freeing
|
|
|
|
kAccessExternalPC = 1 << 4, // access PC can have kExternalPCBit set
|
|
|
|
};
|
|
|
|
|
2014-09-24 01:59:53 +08:00
|
|
|
// Descriptor of user's memory block.
|
|
|
|
struct MBlock {
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 19:23:59 +08:00
|
|
|
u64 siz : 48;
|
|
|
|
u64 tag : 16;
|
2021-09-28 01:43:33 +08:00
|
|
|
StackID stk;
|
|
|
|
Tid tid;
|
2014-09-24 01:59:53 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
COMPILER_CHECK(sizeof(MBlock) == 16);
|
2012-11-23 06:03:11 +08:00
|
|
|
|
ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch builtins...
* ubsan.c (ubsan_expand_null_ifn): Use _v1 suffixed type mismatch
builtins, store max (log2 (align), 0) into uchar field instead of
align into uptr field.
(ubsan_expand_objsize_ifn): Use _v1 suffixed type mismatch builtins,
store uchar 0 field instead of uptr 0 field.
(instrument_nonnull_return): Use _v1 suffixed nonnull return builtin,
instead of passing one address of struct with 2 locations pass
two addresses of structs with 1 location each.
* sanitizer.def (BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_ABORT): Removed.
(BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1,
BUILT_IN_UBSAN_HANDLE_TYPE_MISMATCH_V1_ABORT,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1,
BUILT_IN_UBSAN_HANDLE_NONNULL_RETURN_V1_ABORT): New builtins.
* c-c++-common/ubsan/float-cast-overflow-1.c: Drop value keyword
from expected output regexps.
* c-c++-common/ubsan/float-cast-overflow-2.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-3.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-4.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-5.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-6.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-8.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-9.c: Likewise.
* c-c++-common/ubsan/float-cast-overflow-10.c: Likewise.
* g++.dg/ubsan/float-cast-overflow-bf.C: Likewise.
* gcc.dg/ubsan/float-cast-overflow-bf.c: Likewise.
* g++.dg/asan/default-options-1.C (__asan_default_options): Add
used attribute.
* g++.dg/asan/asan_test.C: Run with ASAN_OPTIONS=handle_segv=2
in the environment.
* All source files: Merge from upstream 315899.
* asan/Makefile.am (nodist_saninclude_HEADERS): Add
include/sanitizer/tsan_interface.h.
* asan/libtool-version: Bump the libasan SONAME.
* lsan/Makefile.am (sanitizer_lsan_files): Add lsan_common_mac.cc.
(lsan_files): Add lsan_linux.cc, lsan_mac.cc and lsan_malloc_mac.cc.
* sanitizer_common/Makefile.am (sanitizer_common_files): Add
sancov_flags.cc, sanitizer_allocator_checks.cc,
sanitizer_coverage_libcdep_new.cc, sanitizer_errno.cc,
sanitizer_file.cc, sanitizer_mac_libcdep.cc and
sanitizer_stoptheworld_mac.cc. Remove sanitizer_coverage_libcdep.cc
and sanitizer_coverage_mapping_libcdep.cc.
* tsan/Makefile.am (tsan_files): Add tsan_external.cc.
* ubsan/Makefile.am (DEFS): Add -DUBSAN_CAN_USE_CXXABI=1.
(ubsan_files): Add ubsan_init_standalone.cc and
ubsan_signals_standalone.cc.
* ubsan/libtool-version: Bump the libubsan SONAME.
* asan/Makefile.in: Regenerate.
* lsan/Makefile.in: Regenerate.
* sanitizer_common/Makefile.in: Regenerate.
* tsan/Makefile.in: Regenerate.
* ubsan/Makefile.in: Regenerate.
From-SVN: r253887
2017-10-19 19:23:59 +08:00
|
|
|
enum ExternalTag : uptr {
|
|
|
|
kExternalTagNone = 0,
|
|
|
|
kExternalTagSwiftModifyingAccess = 1,
|
|
|
|
kExternalTagFirstUserAvailable = 2,
|
|
|
|
kExternalTagMax = 1024,
|
|
|
|
// Don't set kExternalTagMax over 65,536, since MBlock only stores tags
|
|
|
|
// as 16-bit values, see tsan_defs.h.
|
|
|
|
};
|
|
|
|
|
2021-09-28 01:43:33 +08:00
|
|
|
enum MutexType {
|
|
|
|
MutexTypeTrace = MutexLastCommon,
|
|
|
|
MutexTypeReport,
|
|
|
|
MutexTypeSyncVar,
|
|
|
|
MutexTypeAnnotations,
|
|
|
|
MutexTypeAtExit,
|
|
|
|
MutexTypeFired,
|
|
|
|
MutexTypeRacy,
|
|
|
|
MutexTypeGlobalProc,
|
|
|
|
};
|
|
|
|
|
2012-11-23 06:03:11 +08:00
|
|
|
} // namespace __tsan
|
|
|
|
|
|
|
|
#endif // TSAN_DEFS_H
|