annotate libsanitizer/sanitizer_common/sanitizer_common_libcdep.cc @ 122:fb3d53c41846

do not expand code segment
author mir3636
date Thu, 22 Mar 2018 17:37:58 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 //===-- sanitizer_common_libcdep.cc ---------------------------------------===//
kono
parents:
diff changeset
2 //
kono
parents:
diff changeset
3 // This file is distributed under the University of Illinois Open Source
kono
parents:
diff changeset
4 // License. See LICENSE.TXT for details.
kono
parents:
diff changeset
5 //
kono
parents:
diff changeset
6 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
7 //
kono
parents:
diff changeset
8 // This file is shared between AddressSanitizer and ThreadSanitizer
kono
parents:
diff changeset
9 // run-time libraries.
kono
parents:
diff changeset
10 //===----------------------------------------------------------------------===//
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 #include "sanitizer_common.h"
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 #include "sanitizer_allocator_interface.h"
kono
parents:
diff changeset
15 #include "sanitizer_file.h"
kono
parents:
diff changeset
16 #include "sanitizer_flags.h"
kono
parents:
diff changeset
17 #include "sanitizer_procmaps.h"
kono
parents:
diff changeset
18 #include "sanitizer_report_decorator.h"
kono
parents:
diff changeset
19 #include "sanitizer_stackdepot.h"
kono
parents:
diff changeset
20 #include "sanitizer_stacktrace.h"
kono
parents:
diff changeset
21 #include "sanitizer_symbolizer.h"
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 #if SANITIZER_POSIX
kono
parents:
diff changeset
24 #include "sanitizer_posix.h"
kono
parents:
diff changeset
25 #endif
kono
parents:
diff changeset
26
kono
parents:
diff changeset
27 namespace __sanitizer {
kono
parents:
diff changeset
28
kono
parents:
diff changeset
29 #if !SANITIZER_FUCHSIA
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 bool ReportFile::SupportsColors() {
kono
parents:
diff changeset
32 SpinMutexLock l(mu);
kono
parents:
diff changeset
33 ReopenIfNecessary();
kono
parents:
diff changeset
34 return SupportsColoredOutput(fd);
kono
parents:
diff changeset
35 }
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 static INLINE bool ReportSupportsColors() {
kono
parents:
diff changeset
38 return report_file.SupportsColors();
kono
parents:
diff changeset
39 }
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 #else // SANITIZER_FUCHSIA
kono
parents:
diff changeset
42
kono
parents:
diff changeset
43 // Fuchsia's logs always go through post-processing that handles colorization.
kono
parents:
diff changeset
44 static INLINE bool ReportSupportsColors() { return true; }
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 #endif // !SANITIZER_FUCHSIA
kono
parents:
diff changeset
47
kono
parents:
diff changeset
48 bool ColorizeReports() {
kono
parents:
diff changeset
49 // FIXME: Add proper Windows support to AnsiColorDecorator and re-enable color
kono
parents:
diff changeset
50 // printing on Windows.
kono
parents:
diff changeset
51 if (SANITIZER_WINDOWS)
kono
parents:
diff changeset
52 return false;
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 const char *flag = common_flags()->color;
kono
parents:
diff changeset
55 return internal_strcmp(flag, "always") == 0 ||
kono
parents:
diff changeset
56 (internal_strcmp(flag, "auto") == 0 && ReportSupportsColors());
kono
parents:
diff changeset
57 }
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 static void (*sandboxing_callback)();
kono
parents:
diff changeset
60 void SetSandboxingCallback(void (*f)()) {
kono
parents:
diff changeset
61 sandboxing_callback = f;
kono
parents:
diff changeset
62 }
kono
parents:
diff changeset
63
kono
parents:
diff changeset
64 void ReportErrorSummary(const char *error_type, const StackTrace *stack,
kono
parents:
diff changeset
65 const char *alt_tool_name) {
kono
parents:
diff changeset
66 #if !SANITIZER_GO
kono
parents:
diff changeset
67 if (!common_flags()->print_summary)
kono
parents:
diff changeset
68 return;
kono
parents:
diff changeset
69 if (stack->size == 0) {
kono
parents:
diff changeset
70 ReportErrorSummary(error_type);
kono
parents:
diff changeset
71 return;
kono
parents:
diff changeset
72 }
kono
parents:
diff changeset
73 // Currently, we include the first stack frame into the report summary.
kono
parents:
diff changeset
74 // Maybe sometimes we need to choose another frame (e.g. skip memcpy/etc).
kono
parents:
diff changeset
75 uptr pc = StackTrace::GetPreviousInstructionPc(stack->trace[0]);
kono
parents:
diff changeset
76 SymbolizedStack *frame = Symbolizer::GetOrInit()->SymbolizePC(pc);
kono
parents:
diff changeset
77 ReportErrorSummary(error_type, frame->info, alt_tool_name);
kono
parents:
diff changeset
78 frame->ClearAll();
kono
parents:
diff changeset
79 #endif
kono
parents:
diff changeset
80 }
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 static void (*SoftRssLimitExceededCallback)(bool exceeded);
kono
parents:
diff changeset
83 void SetSoftRssLimitExceededCallback(void (*Callback)(bool exceeded)) {
kono
parents:
diff changeset
84 CHECK_EQ(SoftRssLimitExceededCallback, nullptr);
kono
parents:
diff changeset
85 SoftRssLimitExceededCallback = Callback;
kono
parents:
diff changeset
86 }
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 #if SANITIZER_LINUX && !SANITIZER_GO
kono
parents:
diff changeset
89 void BackgroundThread(void *arg) {
kono
parents:
diff changeset
90 uptr hard_rss_limit_mb = common_flags()->hard_rss_limit_mb;
kono
parents:
diff changeset
91 uptr soft_rss_limit_mb = common_flags()->soft_rss_limit_mb;
kono
parents:
diff changeset
92 bool heap_profile = common_flags()->heap_profile;
kono
parents:
diff changeset
93 uptr prev_reported_rss = 0;
kono
parents:
diff changeset
94 uptr prev_reported_stack_depot_size = 0;
kono
parents:
diff changeset
95 bool reached_soft_rss_limit = false;
kono
parents:
diff changeset
96 uptr rss_during_last_reported_profile = 0;
kono
parents:
diff changeset
97 while (true) {
kono
parents:
diff changeset
98 SleepForMillis(100);
kono
parents:
diff changeset
99 uptr current_rss_mb = GetRSS() >> 20;
kono
parents:
diff changeset
100 if (Verbosity()) {
kono
parents:
diff changeset
101 // If RSS has grown 10% since last time, print some information.
kono
parents:
diff changeset
102 if (prev_reported_rss * 11 / 10 < current_rss_mb) {
kono
parents:
diff changeset
103 Printf("%s: RSS: %zdMb\n", SanitizerToolName, current_rss_mb);
kono
parents:
diff changeset
104 prev_reported_rss = current_rss_mb;
kono
parents:
diff changeset
105 }
kono
parents:
diff changeset
106 // If stack depot has grown 10% since last time, print it too.
kono
parents:
diff changeset
107 StackDepotStats *stack_depot_stats = StackDepotGetStats();
kono
parents:
diff changeset
108 if (prev_reported_stack_depot_size * 11 / 10 <
kono
parents:
diff changeset
109 stack_depot_stats->allocated) {
kono
parents:
diff changeset
110 Printf("%s: StackDepot: %zd ids; %zdM allocated\n",
kono
parents:
diff changeset
111 SanitizerToolName,
kono
parents:
diff changeset
112 stack_depot_stats->n_uniq_ids,
kono
parents:
diff changeset
113 stack_depot_stats->allocated >> 20);
kono
parents:
diff changeset
114 prev_reported_stack_depot_size = stack_depot_stats->allocated;
kono
parents:
diff changeset
115 }
kono
parents:
diff changeset
116 }
kono
parents:
diff changeset
117 // Check RSS against the limit.
kono
parents:
diff changeset
118 if (hard_rss_limit_mb && hard_rss_limit_mb < current_rss_mb) {
kono
parents:
diff changeset
119 Report("%s: hard rss limit exhausted (%zdMb vs %zdMb)\n",
kono
parents:
diff changeset
120 SanitizerToolName, hard_rss_limit_mb, current_rss_mb);
kono
parents:
diff changeset
121 DumpProcessMap();
kono
parents:
diff changeset
122 Die();
kono
parents:
diff changeset
123 }
kono
parents:
diff changeset
124 if (soft_rss_limit_mb) {
kono
parents:
diff changeset
125 if (soft_rss_limit_mb < current_rss_mb && !reached_soft_rss_limit) {
kono
parents:
diff changeset
126 reached_soft_rss_limit = true;
kono
parents:
diff changeset
127 Report("%s: soft rss limit exhausted (%zdMb vs %zdMb)\n",
kono
parents:
diff changeset
128 SanitizerToolName, soft_rss_limit_mb, current_rss_mb);
kono
parents:
diff changeset
129 if (SoftRssLimitExceededCallback)
kono
parents:
diff changeset
130 SoftRssLimitExceededCallback(true);
kono
parents:
diff changeset
131 } else if (soft_rss_limit_mb >= current_rss_mb &&
kono
parents:
diff changeset
132 reached_soft_rss_limit) {
kono
parents:
diff changeset
133 reached_soft_rss_limit = false;
kono
parents:
diff changeset
134 if (SoftRssLimitExceededCallback)
kono
parents:
diff changeset
135 SoftRssLimitExceededCallback(false);
kono
parents:
diff changeset
136 }
kono
parents:
diff changeset
137 }
kono
parents:
diff changeset
138 if (heap_profile &&
kono
parents:
diff changeset
139 current_rss_mb > rss_during_last_reported_profile * 1.1) {
kono
parents:
diff changeset
140 Printf("\n\nHEAP PROFILE at RSS %zdMb\n", current_rss_mb);
kono
parents:
diff changeset
141 __sanitizer_print_memory_profile(90, 20);
kono
parents:
diff changeset
142 rss_during_last_reported_profile = current_rss_mb;
kono
parents:
diff changeset
143 }
kono
parents:
diff changeset
144 }
kono
parents:
diff changeset
145 }
kono
parents:
diff changeset
146 #endif
kono
parents:
diff changeset
147
kono
parents:
diff changeset
148 #if !SANITIZER_FUCHSIA && !SANITIZER_GO
kono
parents:
diff changeset
149 void StartReportDeadlySignal() {
kono
parents:
diff changeset
150 // Write the first message using fd=2, just in case.
kono
parents:
diff changeset
151 // It may actually fail to write in case stderr is closed.
kono
parents:
diff changeset
152 CatastrophicErrorWrite(SanitizerToolName, internal_strlen(SanitizerToolName));
kono
parents:
diff changeset
153 static const char kDeadlySignal[] = ":DEADLYSIGNAL\n";
kono
parents:
diff changeset
154 CatastrophicErrorWrite(kDeadlySignal, sizeof(kDeadlySignal) - 1);
kono
parents:
diff changeset
155 }
kono
parents:
diff changeset
156
kono
parents:
diff changeset
157 static void MaybeReportNonExecRegion(uptr pc) {
kono
parents:
diff changeset
158 #if SANITIZER_FREEBSD || SANITIZER_LINUX || SANITIZER_NETBSD
kono
parents:
diff changeset
159 MemoryMappingLayout proc_maps(/*cache_enabled*/ true);
kono
parents:
diff changeset
160 MemoryMappedSegment segment;
kono
parents:
diff changeset
161 while (proc_maps.Next(&segment)) {
kono
parents:
diff changeset
162 if (pc >= segment.start && pc < segment.end && !segment.IsExecutable())
kono
parents:
diff changeset
163 Report("Hint: PC is at a non-executable region. Maybe a wild jump?\n");
kono
parents:
diff changeset
164 }
kono
parents:
diff changeset
165 #endif
kono
parents:
diff changeset
166 }
kono
parents:
diff changeset
167
kono
parents:
diff changeset
168 static void PrintMemoryByte(InternalScopedString *str, const char *before,
kono
parents:
diff changeset
169 u8 byte) {
kono
parents:
diff changeset
170 SanitizerCommonDecorator d;
kono
parents:
diff changeset
171 str->append("%s%s%x%x%s ", before, d.MemoryByte(), byte >> 4, byte & 15,
kono
parents:
diff changeset
172 d.Default());
kono
parents:
diff changeset
173 }
kono
parents:
diff changeset
174
kono
parents:
diff changeset
175 static void MaybeDumpInstructionBytes(uptr pc) {
kono
parents:
diff changeset
176 if (!common_flags()->dump_instruction_bytes || (pc < GetPageSizeCached()))
kono
parents:
diff changeset
177 return;
kono
parents:
diff changeset
178 InternalScopedString str(1024);
kono
parents:
diff changeset
179 str.append("First 16 instruction bytes at pc: ");
kono
parents:
diff changeset
180 if (IsAccessibleMemoryRange(pc, 16)) {
kono
parents:
diff changeset
181 for (int i = 0; i < 16; ++i) {
kono
parents:
diff changeset
182 PrintMemoryByte(&str, "", ((u8 *)pc)[i]);
kono
parents:
diff changeset
183 }
kono
parents:
diff changeset
184 str.append("\n");
kono
parents:
diff changeset
185 } else {
kono
parents:
diff changeset
186 str.append("unaccessible\n");
kono
parents:
diff changeset
187 }
kono
parents:
diff changeset
188 Report("%s", str.data());
kono
parents:
diff changeset
189 }
kono
parents:
diff changeset
190
kono
parents:
diff changeset
191 static void MaybeDumpRegisters(void *context) {
kono
parents:
diff changeset
192 if (!common_flags()->dump_registers) return;
kono
parents:
diff changeset
193 SignalContext::DumpAllRegisters(context);
kono
parents:
diff changeset
194 }
kono
parents:
diff changeset
195
kono
parents:
diff changeset
196 static void ReportStackOverflowImpl(const SignalContext &sig, u32 tid,
kono
parents:
diff changeset
197 UnwindSignalStackCallbackType unwind,
kono
parents:
diff changeset
198 const void *unwind_context) {
kono
parents:
diff changeset
199 SanitizerCommonDecorator d;
kono
parents:
diff changeset
200 Printf("%s", d.Warning());
kono
parents:
diff changeset
201 static const char kDescription[] = "stack-overflow";
kono
parents:
diff changeset
202 Report("ERROR: %s: %s on address %p (pc %p bp %p sp %p T%d)\n",
kono
parents:
diff changeset
203 SanitizerToolName, kDescription, (void *)sig.addr, (void *)sig.pc,
kono
parents:
diff changeset
204 (void *)sig.bp, (void *)sig.sp, tid);
kono
parents:
diff changeset
205 Printf("%s", d.Default());
kono
parents:
diff changeset
206 InternalScopedBuffer<BufferedStackTrace> stack_buffer(1);
kono
parents:
diff changeset
207 BufferedStackTrace *stack = stack_buffer.data();
kono
parents:
diff changeset
208 stack->Reset();
kono
parents:
diff changeset
209 unwind(sig, unwind_context, stack);
kono
parents:
diff changeset
210 stack->Print();
kono
parents:
diff changeset
211 ReportErrorSummary(kDescription, stack);
kono
parents:
diff changeset
212 }
kono
parents:
diff changeset
213
kono
parents:
diff changeset
214 static void ReportDeadlySignalImpl(const SignalContext &sig, u32 tid,
kono
parents:
diff changeset
215 UnwindSignalStackCallbackType unwind,
kono
parents:
diff changeset
216 const void *unwind_context) {
kono
parents:
diff changeset
217 SanitizerCommonDecorator d;
kono
parents:
diff changeset
218 Printf("%s", d.Warning());
kono
parents:
diff changeset
219 const char *description = sig.Describe();
kono
parents:
diff changeset
220 Report("ERROR: %s: %s on unknown address %p (pc %p bp %p sp %p T%d)\n",
kono
parents:
diff changeset
221 SanitizerToolName, description, (void *)sig.addr, (void *)sig.pc,
kono
parents:
diff changeset
222 (void *)sig.bp, (void *)sig.sp, tid);
kono
parents:
diff changeset
223 Printf("%s", d.Default());
kono
parents:
diff changeset
224 if (sig.pc < GetPageSizeCached())
kono
parents:
diff changeset
225 Report("Hint: pc points to the zero page.\n");
kono
parents:
diff changeset
226 if (sig.is_memory_access) {
kono
parents:
diff changeset
227 const char *access_type =
kono
parents:
diff changeset
228 sig.write_flag == SignalContext::WRITE
kono
parents:
diff changeset
229 ? "WRITE"
kono
parents:
diff changeset
230 : (sig.write_flag == SignalContext::READ ? "READ" : "UNKNOWN");
kono
parents:
diff changeset
231 Report("The signal is caused by a %s memory access.\n", access_type);
kono
parents:
diff changeset
232 if (sig.addr < GetPageSizeCached())
kono
parents:
diff changeset
233 Report("Hint: address points to the zero page.\n");
kono
parents:
diff changeset
234 }
kono
parents:
diff changeset
235 MaybeReportNonExecRegion(sig.pc);
kono
parents:
diff changeset
236 InternalScopedBuffer<BufferedStackTrace> stack_buffer(1);
kono
parents:
diff changeset
237 BufferedStackTrace *stack = stack_buffer.data();
kono
parents:
diff changeset
238 stack->Reset();
kono
parents:
diff changeset
239 unwind(sig, unwind_context, stack);
kono
parents:
diff changeset
240 stack->Print();
kono
parents:
diff changeset
241 MaybeDumpInstructionBytes(sig.pc);
kono
parents:
diff changeset
242 MaybeDumpRegisters(sig.context);
kono
parents:
diff changeset
243 Printf("%s can not provide additional info.\n", SanitizerToolName);
kono
parents:
diff changeset
244 ReportErrorSummary(description, stack);
kono
parents:
diff changeset
245 }
kono
parents:
diff changeset
246
kono
parents:
diff changeset
247 void ReportDeadlySignal(const SignalContext &sig, u32 tid,
kono
parents:
diff changeset
248 UnwindSignalStackCallbackType unwind,
kono
parents:
diff changeset
249 const void *unwind_context) {
kono
parents:
diff changeset
250 if (sig.IsStackOverflow())
kono
parents:
diff changeset
251 ReportStackOverflowImpl(sig, tid, unwind, unwind_context);
kono
parents:
diff changeset
252 else
kono
parents:
diff changeset
253 ReportDeadlySignalImpl(sig, tid, unwind, unwind_context);
kono
parents:
diff changeset
254 }
kono
parents:
diff changeset
255
kono
parents:
diff changeset
256 void HandleDeadlySignal(void *siginfo, void *context, u32 tid,
kono
parents:
diff changeset
257 UnwindSignalStackCallbackType unwind,
kono
parents:
diff changeset
258 const void *unwind_context) {
kono
parents:
diff changeset
259 StartReportDeadlySignal();
kono
parents:
diff changeset
260 ScopedErrorReportLock rl;
kono
parents:
diff changeset
261 SignalContext sig(siginfo, context);
kono
parents:
diff changeset
262 ReportDeadlySignal(sig, tid, unwind, unwind_context);
kono
parents:
diff changeset
263 Report("ABORTING\n");
kono
parents:
diff changeset
264 Die();
kono
parents:
diff changeset
265 }
kono
parents:
diff changeset
266
kono
parents:
diff changeset
267 #endif // !SANITIZER_FUCHSIA && !SANITIZER_GO
kono
parents:
diff changeset
268
kono
parents:
diff changeset
269 void WriteToSyslog(const char *msg) {
kono
parents:
diff changeset
270 InternalScopedString msg_copy(kErrorMessageBufferSize);
kono
parents:
diff changeset
271 msg_copy.append("%s", msg);
kono
parents:
diff changeset
272 char *p = msg_copy.data();
kono
parents:
diff changeset
273 char *q;
kono
parents:
diff changeset
274
kono
parents:
diff changeset
275 // Print one line at a time.
kono
parents:
diff changeset
276 // syslog, at least on Android, has an implicit message length limit.
kono
parents:
diff changeset
277 do {
kono
parents:
diff changeset
278 q = internal_strchr(p, '\n');
kono
parents:
diff changeset
279 if (q)
kono
parents:
diff changeset
280 *q = '\0';
kono
parents:
diff changeset
281 WriteOneLineToSyslog(p);
kono
parents:
diff changeset
282 if (q)
kono
parents:
diff changeset
283 p = q + 1;
kono
parents:
diff changeset
284 } while (q);
kono
parents:
diff changeset
285 }
kono
parents:
diff changeset
286
kono
parents:
diff changeset
287 void MaybeStartBackgroudThread() {
kono
parents:
diff changeset
288 #if SANITIZER_LINUX && \
kono
parents:
diff changeset
289 !SANITIZER_GO // Need to implement/test on other platforms.
kono
parents:
diff changeset
290 // Start the background thread if one of the rss limits is given.
kono
parents:
diff changeset
291 if (!common_flags()->hard_rss_limit_mb &&
kono
parents:
diff changeset
292 !common_flags()->soft_rss_limit_mb &&
kono
parents:
diff changeset
293 !common_flags()->heap_profile) return;
kono
parents:
diff changeset
294 if (!&real_pthread_create) return; // Can't spawn the thread anyway.
kono
parents:
diff changeset
295 internal_start_thread(BackgroundThread, nullptr);
kono
parents:
diff changeset
296 #endif
kono
parents:
diff changeset
297 }
kono
parents:
diff changeset
298
kono
parents:
diff changeset
299 static atomic_uintptr_t reporting_thread = {0};
kono
parents:
diff changeset
300
kono
parents:
diff changeset
301 ScopedErrorReportLock::ScopedErrorReportLock() {
kono
parents:
diff changeset
302 uptr current = GetThreadSelf();
kono
parents:
diff changeset
303 for (;;) {
kono
parents:
diff changeset
304 uptr expected = 0;
kono
parents:
diff changeset
305 if (atomic_compare_exchange_strong(&reporting_thread, &expected, current,
kono
parents:
diff changeset
306 memory_order_relaxed)) {
kono
parents:
diff changeset
307 // We've claimed reporting_thread so proceed.
kono
parents:
diff changeset
308 CommonSanitizerReportMutex.Lock();
kono
parents:
diff changeset
309 return;
kono
parents:
diff changeset
310 }
kono
parents:
diff changeset
311
kono
parents:
diff changeset
312 if (expected == current) {
kono
parents:
diff changeset
313 // This is either asynch signal or nested error during error reporting.
kono
parents:
diff changeset
314 // Fail simple to avoid deadlocks in Report().
kono
parents:
diff changeset
315
kono
parents:
diff changeset
316 // Can't use Report() here because of potential deadlocks in nested
kono
parents:
diff changeset
317 // signal handlers.
kono
parents:
diff changeset
318 CatastrophicErrorWrite(SanitizerToolName,
kono
parents:
diff changeset
319 internal_strlen(SanitizerToolName));
kono
parents:
diff changeset
320 static const char msg[] = ": nested bug in the same thread, aborting.\n";
kono
parents:
diff changeset
321 CatastrophicErrorWrite(msg, sizeof(msg) - 1);
kono
parents:
diff changeset
322
kono
parents:
diff changeset
323 internal__exit(common_flags()->exitcode);
kono
parents:
diff changeset
324 }
kono
parents:
diff changeset
325
kono
parents:
diff changeset
326 internal_sched_yield();
kono
parents:
diff changeset
327 }
kono
parents:
diff changeset
328 }
kono
parents:
diff changeset
329
kono
parents:
diff changeset
330 ScopedErrorReportLock::~ScopedErrorReportLock() {
kono
parents:
diff changeset
331 CommonSanitizerReportMutex.Unlock();
kono
parents:
diff changeset
332 atomic_store_relaxed(&reporting_thread, 0);
kono
parents:
diff changeset
333 }
kono
parents:
diff changeset
334
kono
parents:
diff changeset
335 void ScopedErrorReportLock::CheckLocked() {
kono
parents:
diff changeset
336 CommonSanitizerReportMutex.CheckLocked();
kono
parents:
diff changeset
337 }
kono
parents:
diff changeset
338
kono
parents:
diff changeset
339 } // namespace __sanitizer
kono
parents:
diff changeset
340
kono
parents:
diff changeset
341 SANITIZER_INTERFACE_WEAK_DEF(void, __sanitizer_sandbox_on_notify,
kono
parents:
diff changeset
342 __sanitizer_sandbox_arguments *args) {
kono
parents:
diff changeset
343 __sanitizer::PrepareForSandboxing(args);
kono
parents:
diff changeset
344 if (__sanitizer::sandboxing_callback)
kono
parents:
diff changeset
345 __sanitizer::sandboxing_callback();
kono
parents:
diff changeset
346 }