Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
fix a memory corruption
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 25 Feb 2022 09:46:58 +0000 (10:46 +0100)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Fri, 25 Feb 2022 09:48:28 +0000 (10:48 +0100)
Manual refcounting is the devil. Even when it's in LMM.

src/kernel/activity/SemaphoreImpl.cpp

index cf23116..f707757 100644 (file)
@@ -52,7 +52,7 @@ void SemAcquisitionImpl::finish()
     if (surf_action_->get_state() == resource::Action::State::FINISHED) { // The timeout elapsed
       if (granted_) { // but we got the semaphore, just in time!
         set_state(State::DONE);
-        
+
       } else { // we have to report that timeout
         /* Remove myself from the list of interested parties */
         auto issuer = get_issuer();
@@ -68,6 +68,7 @@ void SemAcquisitionImpl::finish()
       }
     }
     surf_action_->unref();
+    surf_action_ = nullptr;
   }
 
   simcall->issuer_->waiting_synchro_ = nullptr;