<div><div><div><div><div dir="auto">Hi John</div><div class="gmail_quote"></div></div></div></div></div><div><div><div><div><div class="gmail_quote"><div dir="auto"><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><ol><li>Deep in the belly of ns-3 (<a href="https://www.nsnam.org/doxygen/simple-ref-count_8h_source.html#l00105" target="_blank">https://www.nsnam.org/doxygen/simple-ref-count_8h_source.html#l00105</a>) - it appears there is an m_count variable, but it's an unsigned 32 bit integer... not 64 bit.  So I'm wondering if the number of references it's tracking exceeds <span style="color:rgb(34,34,34);font-family:Roboto,arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">4,294,967,295.  </span>

 </li></ol></div></div></blockquote></div></div></div></div></div><div><div><div><div class="gmail_quote" dir="auto"><div dir="auto">As I remember, OP is using a 8GB machine. A pointer on amd64 architecture is 8 bytes. If 8GB is filled to the brim with pointers to the same ns3::SimpleRefCount, there are 2^30 pointers. m_count would be 2^30, still less than 2^32-1. Thus, m_count overflow is impossible.</div><div dir="auto"><span style="font-family:"Courier New",Courier,monospace,arial,sans-serif;font-size:14px;white-space:pre-wrap;background-color:rgb(255,255,255)"><br></span></div><div dir="auto"><span style="font-family:"Courier New",Courier,monospace,arial,sans-serif;font-size:14px;white-space:pre-wrap;background-color:rgb(255,255,255)"><br></span></div></div></div></div><div><div class="gmail_quote" dir="auto"></div></div></div><div><div><div class="gmail_quote" dir="auto"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><ol><li><pre class="m_2161873093730341893m_899611466437084604m_-2404624011961664950m_-8446249321044907197gmail-aLF-aPX-K0-aPE" style="display:block;font-family:"Courier New",Courier,monospace,arial,sans-serif;margin:0px;white-space:pre-wrap;word-wrap:break-word;background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><div style="font-family:-apple-system,HelveticaNeue;font-size:16px;white-space:normal" dir="auto"><div class="gmail_quote" dir="auto" style="width:992px"><div dir="auto">Alternatively, the problem most clearly (unclearly?) says it's "</div></div></div></pre></li></ol></div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><ol><li><pre class="m_2161873093730341893m_899611466437084604m_-2404624011961664950m_-8446249321044907197gmail-aLF-aPX-K0-aPE" style="display:block;font-family:"Courier New",Courier,monospace,arial,sans-serif;margin:0px;white-space:pre-wrap;word-wrap:break-word;background-color:rgb(255,255,255);color:rgb(0,0,0);font-size:14px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><div style="font-family:-apple-system,HelveticaNeue;font-size:16px;white-space:normal" dir="auto"><div class="gmail_quote" dir="auto" style="width:992px"><div dir="auto"></div></div></div><div style="font-family:-apple-system,HelveticaNeue;font-size:16px;white-space:normal" dir="auto"><div class="gmail_quote" dir="auto" style="width:992px"><div dir="auto"><span style="font-family:"Courier New",Courier,monospace,arial,sans-serif;font-size:14px;white-space:pre-wrap">Address 0x8 is not stack'd, malloc'd or (recently) free'd</span></div></div></div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:left;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">and</span></pre></li></ol><span style="color:rgb(0,0,0);font-family:"Courier New",Courier,monospace,arial,sans-serif;font-size:14px;white-space:pre-wrap">     ==1647== Process terminating with default action of signal 11 (SIGSEGV) ==1647==  Access not within mapped region at address 0x8</span></div><div><font color="#000000" face="Courier New, Courier, monospace, arial, sans-serif"><span style="font-size:14px;white-space:pre-wrap"><br></span></font></div><div><font color="#000000" face="Courier New, Courier, monospace, arial, sans-serif"><span style="font-size:14px;white-space:pre-wrap"><br></span></font>So I'm wondering...  where is this 0x8 address having a value assigned or being accessed?  0x8 doesn't seem to be a likely memory address to be allocated...  so a pointer is being set to the value "8" somewhere....  I don't see you doing that anywhere.  So I'm wondering if there's a buffer overflow somewhere.<span style="color:rgb(0,0,0);font-family:"Courier New",Courier,monospace,arial,sans-serif;font-size:14px;white-space:pre-wrap"> </span></div></div></blockquote></div></div></div><div><div><div class="gmail_quote" dir="auto"><div dir="auto">This is easy to explain. Assume you have “struct A { uint64_t x; uint64_t y; }”, and you have a nil pointer “A* a = nullptr;”. Trying to access “a->y” causes Valgrind to complain about 0x8 address.</div><div dir="auto">OP’s problem is most likely a memory allocation error. When malloc or C++’s new operator fails, it returns nullptr, and most programmers do not bother checking for them.</div><div dir="auto">Rent a bigger machine! The biggest you can get today is 3.75TB RAM, although 32GB RAM is likely sufficient for this simulation.</div><div dir="auto"><br></div><div dir="auto">Yours, Junxiao</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><span style="color:rgb(0,0,0);font-family:"Courier New",Courier,monospace,arial,sans-serif;font-size:14px;white-space:pre-wrap"></span></div></div>
</blockquote></div></div></div>