2 This file is part of drd, a thread error detector.
4 Copyright (C) 2006-2020 Bart Van Assche <bvanassche@acm.org>.
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
11 This program is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, see <http://www.gnu.org/licenses/>.
19 The GNU General Public License is contained in the file COPYING.
27 #include "pub_drd_bitmap.h" // BmAccessTypeT
28 #include "drd_thread.h" // DrdThreadId
29 #include "pub_tool_basics.h" // SizeT
30 #include "pub_tool_debuginfo.h" // SegInfo
31 #include "pub_tool_errormgr.h" // ExeContext
34 /* DRD error types. */
37 #define STR_DataRaceErr "ConflictingAccess"
39 #define STR_MutexErr "MutexErr"
41 #define STR_CondErr "CondErr"
43 #define STR_CondDestrErr "CondDestrErr"
45 #define STR_CondRaceErr "CondRaceErr"
47 #define STR_CondWaitErr "CondWaitErr"
49 #define STR_SemaphoreErr "SemaphoreErr"
51 #define STR_BarrierErr "BarrierErr"
53 #define STR_RwlockErr "RwlockErr"
55 #define STR_HoldtimeErr "HoldtimeErr"
57 #define STR_GenericErr "GenericErr"
59 #define STR_InvalidThreadId "InvalidThreadId"
61 #define STR_UnimpHgClReq "UnimpHgClReq"
63 #define STR_UnimpDrdClReq "UnimpDrdClReq"
67 /* The classification of a faulting address. */
70 //Undescribed, // as-yet unclassified
72 eUnknown
, // classification yielded nothing useful
75 eSegment
, // in a segment (as defined in pub_tool_debuginfo.h)
76 //UserG, // in a user-defined block
77 //Mempool, // in a mempool
78 //Register, // in a register; for Param errors only
82 /* Records info about a faulting address. */
85 AddrKind akind
; // ALL
87 PtrdiffT rwoffset
; // ALL
88 ExeContext
* lastchange
; // Mallocd
89 DrdThreadId stack_tid
; // Stack
90 DebugInfo
* debuginfo
; // Segment
91 HChar name
[256]; // Segment
92 HChar descr
[256]; // Segment
96 * NOTE: the first member of each error info structure MUST be the thread ID
97 * in which the error has been observed.
100 DrdThreadId tid
; // Thread ID of the running thread.
101 Addr addr
; // Conflicting address in current thread.
102 SizeT size
; // Size in bytes of conflicting operation.
103 BmAccessTypeT access_type
; // Access type: load or store.
146 DrdThreadId other_tid
;
147 ExeContext
* other_context
;
157 Addr synchronization_object
;
158 ExeContext
* acquired_at
;
171 } InvalidThreadIdInfo
;
178 void DRD_(set_show_conflicting_segments
)(const Bool scs
);
179 void DRD_(register_error_handlers
)(void);
180 void DRD_(trace_msg
)(const HChar
* format
, ...) PRINTF_CHECK(1, 2);
181 void DRD_(trace_msg_w_bt
)(const HChar
* format
, ...) PRINTF_CHECK(1, 2);
184 #endif /* __DRD_ERROR_H */