1 //===-- 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 #ifndef SCUDO_REPORT_H_
10 #define SCUDO_REPORT_H_
12 #include "internal_defs.h"
16 // Reports are *fatal* unless stated otherwise.
19 void NORETURN reportError(const char *Message);
21 // Flags related errors.
22 void NORETURN reportInvalidFlag(const char *FlagType, const char *Value);
24 // Chunk header related errors.
25 void NORETURN reportHeaderCorruption(void *Ptr);
26 void NORETURN reportHeaderRace(void *Ptr);
28 // Sanity checks related error.
29 void NORETURN reportSanityCheckError(const char *Field);
31 // Combined allocator errors.
32 void NORETURN reportAlignmentTooBig(uptr Alignment, uptr MaxAlignment);
33 void NORETURN reportAllocationSizeTooBig(uptr UserSize, uptr TotalSize,
35 void NORETURN reportOutOfMemory(uptr RequestedSize);
36 enum class AllocatorAction : u8 {
42 void NORETURN reportInvalidChunkState(AllocatorAction Action, void *Ptr);
43 void NORETURN reportMisalignedPointer(AllocatorAction Action, void *Ptr);
44 void NORETURN reportDeallocTypeMismatch(AllocatorAction Action, void *Ptr,
46 void NORETURN reportDeleteSizeMismatch(void *Ptr, uptr Size, uptr ExpectedSize);
49 void NORETURN reportAlignmentNotPowerOfTwo(uptr Alignment);
50 void NORETURN reportInvalidPosixMemalignAlignment(uptr Alignment);
51 void NORETURN reportCallocOverflow(uptr Count, uptr Size);
52 void NORETURN reportPvallocOverflow(uptr Size);
53 void NORETURN reportInvalidAlignedAllocAlignment(uptr Size, uptr Alignment);
57 #endif // SCUDO_REPORT_H_