1 //===-- report_linux.cpp ----------------------------------------*- 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 //===----------------------------------------------------------------------===//
11 #if SCUDO_LINUX || SCUDO_TRUSTY
14 #include "internal_defs.h"
16 #include "report_linux.h"
17 #include "string_utils.h"
25 // Fatal internal map() error (potentially OOM related).
26 void NORETURN
reportMapError(uptr SizeIfOOM
) {
27 char Error
[128] = "Scudo ERROR: internal map failure\n";
31 "Scudo ERROR: internal map failure (NO MEMORY) requesting %zuKB\n",
34 reportRawError(Error
);
37 void NORETURN
reportUnmapError(uptr Addr
, uptr Size
) {
39 formatString(Error
, sizeof(Error
),
40 "Scudo ERROR: internal unmap failure (error desc=%s) Addr 0x%zx "
42 strerror(errno
), Addr
, Size
);
43 reportRawError(Error
);
46 void NORETURN
reportProtectError(uptr Addr
, uptr Size
, int Prot
) {
50 "Scudo ERROR: internal protect failure (error desc=%s) Addr 0x%zx "
52 strerror(errno
), Addr
, Size
, Prot
);
53 reportRawError(Error
);
58 #endif // SCUDO_LINUX || SCUDO_TRUSTY