From 7590c0078dd53d9ad508725fc27d96705ac3a206 Mon Sep 17 00:00:00 2001 From: Jianzhou Zhao Date: Fri, 12 Feb 2021 03:15:09 +0000 Subject: [PATCH] [dfsan] Turn off THP at dfsan_flush https://reviews.llvm.org/D89662 turned this off at dfsan_init. dfsan_flush also needs to turn it off. W/o this a program may get more and more memory usage after hours. Reviewed-by: morehouse Differential Revision: https://reviews.llvm.org/D96569 --- compiler-rt/lib/dfsan/dfsan.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler-rt/lib/dfsan/dfsan.cpp b/compiler-rt/lib/dfsan/dfsan.cpp index 43a5fe9..7abdf68e 100644 --- a/compiler-rt/lib/dfsan/dfsan.cpp +++ b/compiler-rt/lib/dfsan/dfsan.cpp @@ -551,7 +551,7 @@ static void dfsan_fini() { } extern "C" void dfsan_flush() { - if (!MmapFixedNoReserve(ShadowAddr(), UnusedAddr() - ShadowAddr())) + if (!MmapFixedSuperNoReserve(ShadowAddr(), UnusedAddr() - ShadowAddr())) Die(); } @@ -560,8 +560,7 @@ static void dfsan_init(int argc, char **argv, char **envp) { ::InitializePlatformEarly(); - if (!MmapFixedSuperNoReserve(ShadowAddr(), UnusedAddr() - ShadowAddr())) - Die(); + dfsan_flush(); if (common_flags()->use_madv_dontdump) DontDumpShadowMemory(ShadowAddr(), UnusedAddr() - ShadowAddr()); -- 2.7.4