1 //===-- tsan_report.h -------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file is a part of ThreadSanitizer (TSan), a race detector.
11 //===----------------------------------------------------------------------===//
15 #include "sanitizer_common/sanitizer_symbolizer.h"
16 #include "sanitizer_common/sanitizer_thread_registry.h"
17 #include "sanitizer_common/sanitizer_vector.h"
18 #include "tsan_defs.h"
25 ReportTypeUseAfterFree
,
26 ReportTypeVptrUseAfterFree
,
27 ReportTypeExternalRace
,
29 ReportTypeMutexDestroyLocked
,
30 ReportTypeMutexDoubleLock
,
31 ReportTypeMutexInvalidAccess
,
32 ReportTypeMutexBadUnlock
,
33 ReportTypeMutexBadReadLock
,
34 ReportTypeMutexBadReadUnlock
,
35 ReportTypeSignalUnsafe
,
36 ReportTypeErrnoInSignal
,
41 SymbolizedStack
*frames
= nullptr;
42 bool suppressable
= false;
45 struct ReportMopMutex
{
57 Vector
<ReportMopMutex
> mset
;
63 enum ReportLocationType
{
71 struct ReportLocation
{
72 ReportLocationType type
= ReportLocationGlobal
;
74 uptr heap_chunk_start
= 0;
75 uptr heap_chunk_size
= 0;
76 uptr external_tag
= 0;
77 Tid tid
= kInvalidTid
;
79 bool suppressable
= false;
80 ReportStack
*stack
= nullptr;
87 ThreadType thread_type
;
103 Vector
<ReportStack
*> stacks
;
104 Vector
<ReportMop
*> mops
;
105 Vector
<ReportLocation
*> locs
;
106 Vector
<ReportMutex
*> mutexes
;
107 Vector
<ReportThread
*> threads
;
108 Vector
<Tid
> unique_tids
;
117 ReportDesc(const ReportDesc
&);
118 void operator = (const ReportDesc
&);
121 // Format and output the report to the console/log. No additional logic.
122 void PrintReport(const ReportDesc
*rep
);
123 void PrintStack(const ReportStack
*stack
);
125 } // namespace __tsan
127 #endif // TSAN_REPORT_H