<div dir="ltr">Usually this kind of error is caused by a buffer overflow. Somewhere you are writing data beyond the boundaries of a buffer, and it is overwriting C runtime information about allocated memory, causing an error when you try to free() it.<div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature"><div dir="ltr">-- <br>Tyler Romeo<br>Stevens Institute of Technology<br>Class of 2016</div></div></div>
<br><div class="gmail_quote">On Fri, Oct 16, 2015 at 10:40 PM, Patrick Murray <span dir="ltr">&lt;<a href="mailto:pmurray1@stevens.edu" target="_blank">pmurray1@stevens.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">How would you recommend we approach memory related errors? I have been experiencing the following two errors in particular:<br><ol><li>free(): invalid next size (normal)</li><li>munmap_chunk(): invalid pointer</li></ol><p>Instead of using malloc, I&#39;ve switched to calloc to initialize the memory to zero. Additionally, I&#39;ve attempted to free up memory when no longer needed. However, these errors still persist. I&#39;ve tried to use valgrind and gdb to debug their causes but am a little overwhelmed by their outputs (the errors only occur when traversing a large number of entires, think &quot;/&quot; recursively)</p><p>-Pat<br></p></div>
<br>_______________________________________________<br>
cs631apue mailing list<br>
<a href="mailto:cs631apue@lists.stevens.edu">cs631apue@lists.stevens.edu</a><br>
<a href="https://lists.stevens.edu/mailman/listinfo/cs631apue" rel="noreferrer" target="_blank">https://lists.stevens.edu/mailman/listinfo/cs631apue</a><br>
<br></blockquote></div><br></div>