1 //===-- asan_report.h -------------------------------------------*- C++ -*-===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of AddressSanitizer, an address sanity checker.
10 // ASan-private header for error reporting functions.
11 //===----------------------------------------------------------------------===//
13 #include "asan_internal.h"
14 #include "asan_thread.h"
15 #include "sanitizer/asan_interface.h"
19 // The following functions prints address description depending
20 // on the memory type (shadow/heap/stack/global).
21 void DescribeHeapAddress(uptr addr
, uptr access_size
);
22 bool DescribeAddressIfGlobal(uptr addr
);
23 bool DescribeAddressRelativeToGlobal(uptr addr
, const __asan_global
&g
);
24 bool DescribeAddressIfShadow(uptr addr
);
25 bool DescribeAddressIfStack(uptr addr
, uptr access_size
);
26 // Determines memory type on its own.
27 void DescribeAddress(uptr addr
, uptr access_size
);
29 void DescribeThread(AsanThreadSummary
*summary
);
31 // Different kinds of error reports.
32 void NORETURN
ReportSIGSEGV(uptr pc
, uptr sp
, uptr bp
, uptr addr
);
33 void NORETURN
ReportDoubleFree(uptr addr
, StackTrace
*stack
);
34 void NORETURN
ReportFreeNotMalloced(uptr addr
, StackTrace
*stack
);
35 void NORETURN
ReportMallocUsableSizeNotOwned(uptr addr
,
37 void NORETURN
ReportAsanGetAllocatedSizeNotOwned(uptr addr
,
39 void NORETURN
ReportStringFunctionMemoryRangesOverlap(
40 const char *function
, const char *offset1
, uptr length1
,
41 const char *offset2
, uptr length2
, StackTrace
*stack
);
43 // Mac-specific errors and warnings.
44 void WarnMacFreeUnallocated(
45 uptr addr
, uptr zone_ptr
, const char *zone_name
, StackTrace
*stack
);
46 void NORETURN
ReportMacMzReallocUnknown(
47 uptr addr
, uptr zone_ptr
, const char *zone_name
, StackTrace
*stack
);
48 void NORETURN
ReportMacCfReallocUnknown(
49 uptr addr
, uptr zone_ptr
, const char *zone_name
, StackTrace
*stack
);