From: Martin Quinson Date: Sat, 3 Apr 2021 07:42:34 +0000 (+0200) Subject: Tell when we have more leaked handles to display X-Git-Tag: v3.28~479 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/bceb06a3d8d126f6e838a21a4cf876fa87370d66 Tell when we have more leaked handles to display --- diff --git a/src/smpi/internals/smpi_utils.cpp b/src/smpi/internals/smpi_utils.cpp index 1cca1eda2d..80ed460a46 100644 --- a/src/smpi/internals/smpi_utils.cpp +++ b/src/smpi/internals/smpi_utils.cpp @@ -146,8 +146,11 @@ void print_memory_analysis() int n = simgrid::config::get_value("smpi/list-leaks"); for (auto const& p : *simgrid::smpi::F2C::lookup()) { static int printed = 0; - if (printed >= n) + if (printed >= n) { + if (n > 0) + XBT_WARN("(more handle leaks hidden as you wanted to see only %d of them)", n); break; + } if (p.first >= simgrid::smpi::F2C::get_num_default_handles()) { if (xbt_log_no_loc) { XBT_WARN("Leaked handle of type %s", boost::core::demangle(typeid(*(p.second)).name()).c_str()); diff --git a/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh b/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh index 267c833811..becf06c8ff 100644 --- a/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh +++ b/teshsuite/smpi/coll-allreduce-with-leaks/coll-allreduce-with-leaks.tesh @@ -34,6 +34,7 @@ $ $VALGRIND_NO_LEAK_CHECK ${bindir:=.}/../../../smpi_script/bin/smpirun -map -ho > [0.023768] [smpi_utils/WARNING] Leaked handle of type simgrid::smpi::Comm > [0.023768] [smpi_utils/WARNING] Leaked handle of type simgrid::smpi::Group > [0.023768] [smpi_utils/WARNING] Leaked handle of type simgrid::smpi::Comm +> [0.023768] [smpi_utils/WARNING] (more handle leaks hidden as you wanted to see only 10 of them) > [0.023768] [smpi_utils/INFO] Memory Usage: Simulated application allocated 2048 bytes during its lifetime through malloc/calloc calls.