[ndnSIM] Forwarder class fragility when undergoing modification
jpbaugh at umich.edu
Mon Jul 31 22:39:35 PDT 2017
Greetings again friends,
My apologies - please ignore the last e-mail. Apparently I had a weird
situation where the Policy object was nullptr and that was because I had
some of my set methods out of order, and created some other objects in the
wrong order. It does seem a bit fragile for such a weird error to occur,
but I think in this particular case, it's a C++ issue, not an ndnSIM issue.
On Tue, Aug 1, 2017 at 12:28 AM, John Baugh <jpbaugh at umich.edu> wrote:
> Greetings ndnSIM friends,
> This is more of a general question since it's happened multiple times.
> I've managed to find various ways of working around the issue before, but
> I'm trying to get an idea of the root cause. So, even though a more
> general question, I'll try and give my specific example.
> So, I was going to put two private data members (fields) into the
> forwarder.hpp file in Forwarder class:
> * contentHitCount
> * contentMissCount
> I assumed I could initialize them to zero in the constructor, increment
> them inside the respective onContentStoreHit and onContentStoreMiss methods
> inside Forwarder, and then I could obtain data from them.
> But even *adding *one of these variables to the private data of the
> Forwarder class (and doing nothing else) causing a segmentation fault when
> the forwarding strategy is about to be set in the main simulation file.
> This is the only thing I changed. I added a private data member. An
> integer. Nothing else. (Yes, I also tried with ctor initializer list to
> set it to 0, and to set it to 0 inside the ctor - same result.)
> Is there some general fragility related to the Forwarder class that makes
> it difficult to modify? It just seems like adding a variable shouldn't
> cause a SEGFAULT.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ndnSIM