From: Martin Quinson Date: Sun, 19 Mar 2023 18:45:39 +0000 (+0100) Subject: MC: disable Address Space Layout Randomization in the application X-Git-Tag: v3.34~293 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/b78382937bed8a3b94baab7984b50ecb7417053e 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. --- 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