From f5b4cca65c5bad8a1e55d9b3b06f1c55f6d69887 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 8 Jul 2020 15:07:19 +0200 Subject: executor: prohibit malloc --- executor/executor.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'executor') diff --git a/executor/executor.cc b/executor/executor.cc index 2ce50661d..f9dd22dda 100644 --- a/executor/executor.cc +++ b/executor/executor.cc @@ -49,6 +49,13 @@ typedef unsigned char uint8; // because some standard libraries contain "using ::exit;", but has different signature. #define exit vsnprintf +// Dynamic memory allocation reduces test reproducibility across different libc versions and kernels. +// malloc will cause unspecified number of additional mmap's at unspecified locations. +// For small objects prefer stack allocations, for larger -- either global objects (this may have +// issues with concurrency), or controlled mmaps, or make the fuzzer allocate memory. +#define malloc do_not_use_malloc +#define calloc do_not_use_calloc + // Note: zircon max fd is 256. // Some common_OS.h files know about this constant for RLIMIT_NOFILE. const int kMaxFd = 250; -- cgit mrf-deployment