From 5a567ca84bc683ed919ed447667bf525cc21552d Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 2 Mar 2023 15:53:35 +0100 Subject: [PATCH] Message is retrieved as an unsigned long (according to the manual). --- src/mc/ModelChecker.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mc/ModelChecker.cpp b/src/mc/ModelChecker.cpp index 1e700b0a03..051a8462d8 100644 --- a/src/mc/ModelChecker.cpp +++ b/src/mc/ModelChecker.cpp @@ -284,7 +284,9 @@ void ModelChecker::handle_waitpid() // From PTRACE_O_TRACEEXIT: #ifdef __linux__ if (status>>8 == (SIGTRAP | (PTRACE_EVENT_EXIT<<8))) { - xbt_assert(ptrace(PTRACE_GETEVENTMSG, remote_process_->pid(), 0, &status) != -1, "Could not get exit status"); + unsigned long eventmsg; + xbt_assert(ptrace(PTRACE_GETEVENTMSG, remote_process_->pid(), 0, &eventmsg) != -1, "Could not get exit status"); + status = static_cast(eventmsg); if (WIFSIGNALED(status)) { MC_report_crash(exploration_, status); this->get_remote_process().terminate(); -- 2.20.1