<div dir="auto">Junxiao,<div dir="auto"><br></div><div dir="auto">Thank you for the information.  I think the static variable will work.</div><div dir="auto"><br></div><div dir="auto">However, as I had originally described, the program results in a segmentation fault upon assignment operation with an instance field / data member.</div><div dir="auto"><br></div><div dir="auto">The only workaround I can really think of, if each PStat object needs its own copy is to use a static counter and a static array of Popularity Manager objects.</div><div dir="auto"><br></div><div dir="auto">This still seems silly that it crashes from a simple assignment statement.  I'm also still curious WHY it's doing this exactly and if there's a better solution.  </div><div dir="auto"><br></div><div dir="auto">I had posted a valgrind output but not sure if everyone got that.  I might have to post it through a link on Google Drive.</div><div dir="auto"><br></div><div dir="auto">Thanks everyone!</div><div dir="auto"><br></div><div dir="auto">John</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Apr 16, 2017 11:56 PM, "Junxiao Shi" <<a href="mailto:shijunxiao@email.arizona.edu">shijunxiao@email.arizona.edu</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi John<div><br></div><div>ndnSIM creates multiple NFD instances in the same address space.</div><div>As a result, any global variable (including static members) you use will be shared across all network nodes. If this isn't the intention, the implementation is wrong.</div><div><br></div><div>Also, as stated in NFD developer guide, the Strategy instance is stateless, while all states needed by strategy should be stored in tables. If you find more instances of your strategy than the number of nodes, this is the reason.</div><div>AsfStrategy is a good example on how to implement a complex strategy with multiple components, while still keeping all states in tables.</div><div><br></div><div>Yours, Junxiao</div><div><br><div class="gmail_quote"><div>On Sat, Apr 15, 2017 at 22:49 John Baugh <<a href="mailto:jpbaugh@umich.edu" target="_blank">jpbaugh@umich.edu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div><div><div><div><div>Greetings all,<br><br></div>I *think* I may have solved the problem (I will need more testing.)<br><br></div>I noticed that my PStrat ctor is called multiple times, so obviously any of the instance variables used by PStrat objects will be at different memory locations.  I think Junxiao's suggestion that the program was trying to destroy the object multiple times might have been accurate.<br><br></div>I made the shared_ptr to the PopularityManager object <b>static </b>so that all instances will share the same object.  The program does not appear to crash now.<br><br></div>I will do further testing, but I think this may have solved the issue.  It is still quite bizarre.<br><br></div>Thanks,<br><br></div>John</div></blockquote></div></div>
</blockquote></div></div>