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
;
43 static ReportStack
*New();
49 struct ReportMopMutex
{
61 Vector
<ReportMopMutex
> mset
;
67 enum ReportLocationType
{
75 struct ReportLocation
{
76 ReportLocationType type
;
78 uptr heap_chunk_start
;
86 static ReportLocation
*New(ReportLocationType type
);
88 explicit ReportLocation(ReportLocationType type
);
95 ThreadType thread_type
;
112 Vector
<ReportStack
*> stacks
;
113 Vector
<ReportMop
*> mops
;
114 Vector
<ReportLocation
*> locs
;
115 Vector
<ReportMutex
*> mutexes
;
116 Vector
<ReportThread
*> threads
;
117 Vector
<int> unique_tids
;
125 ReportDesc(const ReportDesc
&);
126 void operator = (const ReportDesc
&);
129 // Format and output the report to the console/log. No additional logic.
130 void PrintReport(const ReportDesc
*rep
);
131 void PrintStack(const ReportStack
*stack
);
133 } // namespace __tsan
135 #endif // TSAN_REPORT_H