From 305d783c9c259a5ec28836bdf697f73c6451aa2f Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Mon, 13 Nov 2023 21:44:26 +0100 Subject: [PATCH] Try to fix a failure about mutex freed too early in RMA --- src/kernel/activity/MutexImpl.hpp | 3 ++- src/smpi/mpi/smpi_win.cpp | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/kernel/activity/MutexImpl.hpp b/src/kernel/activity/MutexImpl.hpp index 51ef640157..75cb5d6874 100644 --- a/src/kernel/activity/MutexImpl.hpp +++ b/src/kernel/activity/MutexImpl.hpp @@ -100,7 +100,8 @@ public: { if (mutex->refcount_.fetch_sub(1) == 1) { xbt_assert(mutex->ongoing_acquisitions_.empty(), "The destroyed mutex still had ongoing acquisitions"); - xbt_assert(mutex->owner_ == nullptr, "The destroyed mutex is still owned by %s", mutex->owner_->get_cname()); + xbt_assert(mutex->owner_ == nullptr, "The destroyed mutex is still owned by actor %s", + mutex->owner_->get_cname()); delete mutex; } } diff --git a/src/smpi/mpi/smpi_win.cpp b/src/smpi/mpi/smpi_win.cpp index 7b33c80243..b6d1f34e1e 100644 --- a/src/smpi/mpi/smpi_win.cpp +++ b/src/smpi/mpi/smpi_win.cpp @@ -97,6 +97,8 @@ int Win::del(Win* win){ } if (win->allocated_) xbt_free(win->base_); + if (win->mut_->get_owner() != nullptr) + win->mut_->unlock(); F2C::free_f(win->f2c_id()); win->cleanup_attr(); -- 2.20.1