From: Christophe ThiƩry Date: Thu, 5 Jan 2012 17:01:13 +0000 (+0100) Subject: When a process leaves, no one should ever finish a communication with it X-Git-Tag: exp_20120216~195^2~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/cb025a65332d7a4d6b878b00873b3da07f15021a When a process leaves, no one should ever finish a communication with it Its unstarted comms must never get matched in the future and its started comms must be canceled, no matter if they are detached. --- diff --git a/src/simix/smx_process.c b/src/simix/smx_process.c index f45d326155..e57176a749 100644 --- a/src/simix/smx_process.c +++ b/src/simix/smx_process.c @@ -41,9 +41,9 @@ void SIMIX_process_cleanup(smx_process_t process) smx_action_t action; while ((action = xbt_fifo_pop(process->comms))) { - /* make sure no one will finish the comm after this process is destroyed (unless it's detached) */ - if (!action->comm.detached || action->comm.src_proc != process) - SIMIX_comm_cancel(action); + /* make sure no one will finish the comm after this process is destroyed, + * because src_proc or dst_proc would be an invalid pointer */ + SIMIX_comm_cancel(action); if (action->comm.src_proc == process) { XBT_DEBUG("Found an unfinished send comm %p (detached = %d), state %d, src = %p, dst = %p", @@ -58,7 +58,9 @@ void SIMIX_process_cleanup(smx_process_t process) action->comm.refcount++; SIMIX_comm_destroy(action); } - XBT_DEBUG("Don't destroy it since its refcount is %d",action->comm.refcount); + else { + XBT_DEBUG("Don't destroy it since its refcount is %d", action->comm.refcount); + } } else { SIMIX_comm_destroy(action); }