From 48b4bddb91d8a8a9dc21eb81ccdb01e7d05fa19c Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Tue, 3 Apr 2018 16:19:47 +0200 Subject: [PATCH] sensible error messages when ending the daemons result in a deadlock (fix #258) --- src/simix/smx_global.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/simix/smx_global.cpp b/src/simix/smx_global.cpp index cdad122f8a..447f55cdbe 100644 --- a/src/simix/smx_global.cpp +++ b/src/simix/smx_global.cpp @@ -543,10 +543,19 @@ void SIMIX_run() TRACE_end(); - XBT_CRITICAL("Oops ! Deadlock or code not perfectly clean."); - SIMIX_display_process_status(); - simgrid::s4u::onDeadlock(); - xbt_abort(); + if (simix_global->process_list.size() <= simix_global->daemons.size()) { + XBT_CRITICAL("Oops! Daemon actors cannot do any blocking activity (communications, synchronization, etc) " + "once the simulation is over. Please fix your on_exit() functions."); + SIMIX_display_process_status(); + simgrid::s4u::onDeadlock(); + xbt_abort(); + + } else { + XBT_CRITICAL("Oops! Deadlock or code not perfectly clean."); + SIMIX_display_process_status(); + simgrid::s4u::onDeadlock(); + xbt_abort(); + } } simgrid::s4u::onSimulationEnd(); } -- 2.20.1