From f652049527bb8c8baa4bc22ed5a718ae842e5fc2 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Fri, 26 Aug 2022 11:09:30 +0200 Subject: [PATCH] Avoid to send/receive zero-size messages. There seems to be something broken with them on freebsd. --- src/mc/api/RemoteApp.cpp | 6 ++++-- src/mc/remote/AppSide.cpp | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mc/api/RemoteApp.cpp b/src/mc/api/RemoteApp.cpp index d7c1037db8..6cf19b0a42 100644 --- a/src/mc/api/RemoteApp.cpp +++ b/src/mc/api/RemoteApp.cpp @@ -166,8 +166,10 @@ void RemoteApp::get_actors_status(std::map& whereto) const (int)sizeof(answer)); s_mc_message_actors_status_one_t status[answer.count]; - received = model_checker_->channel().receive(&status, sizeof(status)); - xbt_assert(static_cast(received) == sizeof(status)); + if (answer.count > 0) { + received = model_checker_->channel().receive(&status, sizeof(status)); + xbt_assert(static_cast(received) == sizeof(status)); + } whereto.clear(); for (auto const& actor : status) diff --git a/src/mc/remote/AppSide.cpp b/src/mc/remote/AppSide.cpp index ec9e43a6e3..690d190147 100644 --- a/src/mc/remote/AppSide.cpp +++ b/src/mc/remote/AppSide.cpp @@ -158,7 +158,8 @@ void AppSide::handle_actors_status() const i++; } xbt_assert(channel_.send(answer) == 0, "Could not send ACTORS_STATUS_REPLY msg"); - xbt_assert(channel_.send(status, sizeof(status)) == 0, "Could not send ACTORS_STATUS_REPLY data"); + if (answer.count > 0) + xbt_assert(channel_.send(status, sizeof(status)) == 0, "Could not send ACTORS_STATUS_REPLY data"); } #define assert_msg_size(_name_, _type_) \ -- 2.20.1