Project

General

Profile

Actions

Bug #4596

closed

Segfault in Face::Impl::satisfyPendingInterests

Added by Ashlesh Gawande almost 6 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
04/26/2018
Due date:
% Done:

100%

Estimated time:
1.00 h

Description

Ubuntu 17.10
gcc 7.2.0

ndn-cxx: 974b81aeed570be328cf99495e16fbe1b7d0a563 (master HEAD)
NFD: 21e0193e5c81f1c4e8bd50c0d63f2e199eb140c2 (master HEAD)

Running psync-repo and psync-consumer found here:
https://netwisdom.cs.memphis.edu/gitlab/mzhang4/psync/tree/emulation/tools

Experiment I ran:
https://netwisdom.cs.memphis.edu/gitlab/agawande/psync-mini-ndn/blob/emulation/ndn/experiments/partial-sync.py
with the attached topology.

Getting the segfault after face.put here:
https://netwisdom.cs.memphis.edu/gitlab/mzhang4/psync/blob/emulation/src/logic_repo.cpp#L199

I don't know how to reproduce the error except running the Mini-NDN experiment and waiting for repo-exp (psync-repo is the binary that is installed) to
crash. Only some (2-4) of the psync-repo out of 5 running crash. The crashes happen after running for a while (within 2-5 minutes).
Backtrace of the crash is attached.

Segfault happens when m_pendingInterestTable.erase(i) empties m_pendingInterestTable (.size() = 0) iirc.

If I make the following changes it fixes the crash (at least does not happen for ~30 minutes):

diff --git a/src/detail/face-impl.hpp b/src/detail/face-impl.hpp
index 86945ba6..be0c9515 100644
--- a/src/detail/face-impl.hpp
+++ b/src/detail/face-impl.hpp
@@ -136,7 +136,6 @@ public: // consumer
       }

       NDN_LOG_DEBUG("   satisfying " << *entry->getInterest() << " from " << entry->getOrigin());
-      i = m_pendingInterestTable.erase(i);

       if (entry->getOrigin() == PendingInterestOrigin::APP) {
         hasAppMatch = true;
@@ -145,6 +144,8 @@ public: // consumer
       else {
         hasForwarderMatch = true;
       }
+
+      i = m_pendingInterestTable.erase(i);
     }
     // if Data matches no pending Interest record, it is sent to the forwarder as unsolicited Data
     return hasForwarderMatch || !hasAppMatch;


Files

bt-full.txt (27.7 KB) bt-full.txt Ashlesh Gawande, 04/26/2018 09:15 PM
20cons-5repo.conf (2.11 KB) 20cons-5repo.conf Ashlesh Gawande, 04/26/2018 09:16 PM
scenario.zip (1.01 MB) scenario.zip Ashlesh Gawande, 05/09/2018 01:25 PM
Actions

Also available in: Atom PDF