Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Message is retrieved as an unsigned long (according to the manual).
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 2 Mar 2023 14:53:35 +0000 (15:53 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Thu, 2 Mar 2023 15:00:37 +0000 (16:00 +0100)
src/mc/ModelChecker.cpp

index 1e700b0..051a846 100644 (file)
@@ -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<int>(eventmsg);
         if (WIFSIGNALED(status)) {
           MC_report_crash(exploration_, status);
           this->get_remote_process().terminate();