X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/92e3bfcf13304cf11bc64722974dfdca8b2ae6d4..6659e698628302ff3b8663fe612044375e092fe3:/src/mc/simgrid_mc.cpp diff --git a/src/mc/simgrid_mc.cpp b/src/mc/simgrid_mc.cpp index 1d517f1f81..f56cc71cce 100644 --- a/src/mc/simgrid_mc.cpp +++ b/src/mc/simgrid_mc.cpp @@ -1,4 +1,4 @@ - /* Copyright (c) 2015. The SimGrid Team. +/* Copyright (c) 2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -68,6 +68,11 @@ static int do_child(int socket, char** argv) // Set environment: setenv(MC_ENV_VARIABLE, "1", 1); + // Disable lazy relocation in the model-ched process. + // We don't want the model-checked process to modify its .got.plt during + // snapshot. + setenv("LC_BIND_NOW", "1", 1); + char buffer[64]; res = std::snprintf(buffer, sizeof(buffer), "%i", socket); if ((size_t) res >= sizeof(buffer) || res == -1) @@ -114,6 +119,8 @@ static char** argvdup(int argc, char** argv) int main(int argc, char** argv) { + _sg_do_model_check = 1; + // We need to keep the original parameters in order to pass them to the // model-checked process: int argc_copy = argc; @@ -124,25 +131,6 @@ int main(int argc, char** argv) if (argc < 2) xbt_die("Missing arguments.\n"); - bool server_mode = true; - char* env = std::getenv("SIMGRID_MC_MODE"); - if (env) { - if (std::strcmp(env, "server") == 0) - server_mode = true; - else if (std::strcmp(env, "standalone") == 0) - server_mode = false; - else - xbt_die("Unrecognised value for SIMGRID_MC_MODE (server/standalone)"); - } - - if (!server_mode) { - setenv(MC_ENV_VARIABLE, "1", 1); - execvp(argv[1], argv+1); - - std::perror("simgrid-mc"); - return 127; - } - // Create a AF_LOCAL socketpair: int res;