Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix an issue in process autorestart
authorSamuel Lepetit <samuel.lepetit@inria.fr>
Thu, 28 Jun 2012 13:16:28 +0000 (15:16 +0200)
committerSamuel Lepetit <samuel.lepetit@inria.fr>
Thu, 28 Jun 2012 13:16:38 +0000 (15:16 +0200)
src/simix/smx_host.c
src/simix/smx_process.c

index 1d41473..248eb91 100644 (file)
@@ -179,12 +179,7 @@ void _SIMIX_host_free_process_arg(void *);
 void _SIMIX_host_free_process_arg(void *data)
 {
   smx_process_arg_t arg = *(void**)data;
-  int i;
   xbt_free(arg->name);
-  for (i = 0; i < arg->argc; i++) {
-    xbt_free(arg->argv[i]);
-  }
-  xbt_free(arg->argv);
   xbt_free(arg);
 }
 /**
@@ -208,14 +203,14 @@ void SIMIX_host_add_auto_restart_process(smx_host_t host,
     host->auto_restart_processes = xbt_dynar_new(sizeof(smx_process_arg_t),_SIMIX_host_free_process_arg);
   }
   smx_process_arg_t arg = xbt_new(s_smx_process_arg_t,1);
-
   arg->name = xbt_strdup(name);
   arg->code = code;
   arg->data = data;
   arg->hostname = hostname;
   arg->kill_time = kill_time;
   arg->argc = argc;
-  arg->argv = xbt_new(char*,argc + 1);
+
+  arg->argv = xbt_new(char*,argc);
 
   int i;
   for (i = 0; i < argc; i++) {
index ceac7f0..ecd9e50 100644 (file)
@@ -164,6 +164,7 @@ void SIMIX_process_stop(smx_process_t arg) {
                                         arg->argc,arg->argv,arg->properties,
                                         arg->auto_restart);
   }
+  XBT_DEBUG("Process %s (%s) is dead",arg->name,arg->smx_host->name);
   /* stop the context */
   SIMIX_context_stop(arg->context);
 }