From b78382937bed8a3b94baab7984b50ecb7417053e Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sun, 19 Mar 2023 19:45:39 +0100 Subject: [PATCH] MC: disable Address Space Layout Randomization in the application This will allow to re-fork the application on restore without invalidating all the metadata we accumulated in the previous exploration traces. --- src/mc/api/RemoteApp.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mc/api/RemoteApp.cpp b/src/mc/api/RemoteApp.cpp index ba3a14f645..b25e42f2d5 100644 --- a/src/mc/api/RemoteApp.cpp +++ b/src/mc/api/RemoteApp.cpp @@ -24,6 +24,7 @@ #include #ifdef __linux__ +#include #include #endif #include @@ -59,6 +60,12 @@ XBT_ATTRIB_NORETURN static void run_child_process(int socket, const std::vector< sigemptyset(&mask); xbt_assert(sigprocmask(SIG_SETMASK, &mask, nullptr) >= 0, "Could not unblock signals"); xbt_assert(prctl(PR_SET_PDEATHSIG, SIGHUP) == 0, "Could not PR_SET_PDEATHSIG"); + + // Make sure that the application process layout is not randomized, so that the info we gather is stable over re-execs + if (personality(ADDR_NO_RANDOMIZE) == -1) { + XBT_ERROR("Could not set the NO_RANDOMIZE personality"); + throw xbt::errno_error(); + } #endif // Remove CLOEXEC to pass the socket to the application -- 2.20.1