<div dir="ltr">Hi<div><br><div>I'm running into an issue while storing port variants into another table in the registry database. The output is different every time and breaks at different places (though I can expect such erroneous behavior in case of such errors), many times finishing successfully.</div></div><div><br></div><div>The common error which it gives me is:</div><div><br></div><div>----</div><div>tclsh8.5(25738,0x7fff9815d3c0) malloc: *** error for object 0x7f8e005023b8: incorrect checksum for freed object - object was probably modified after being freed.<br></div><div>
<p class="gmail-p1"><span class="gmail-s1">*** set a breakpoint in malloc_error_break to debug</span></p><p class="gmail-p1">----</p><p class="gmail-p1">I tried debugging a lot for over a day but not able to find anything.</p><p class="gmail-p1">Sometimes, it gives me a Segmentation fault or Abort error: 6, all of them indicating an issue with memory management.</p><p class="gmail-p1">If someone can try replicating the error, it'd be great. The repo is here [1]. The issue seems to be around here [2] in this function. After `make`, `sudo make install`, all you have to run is `<install-directory>/bin/port snapshot`.</p><p class="gmail-p1">I am only using vim for development and unable to add any breakpoints and use GDB since it walks through Tcl.</p><p class="gmail-p1"><br></p><p class="gmail-p1">[1]: <a href="https://github.com/umeshksingla/macports-base/tree/gsoc17-migrate">https://github.com/umeshksingla/macports-base/tree/gsoc17-migrate</a></p><p class="gmail-p1">[2]: <a href="https://github.com/umeshksingla/macports-base/blob/gsoc17-migrate/src/cregistry/entry.c#L1422">https://github.com/umeshksingla/macports-base/blob/gsoc17-migrate/src/cregistry/entry.c#L1422</a></p><p class="gmail-p1"><br></p><p class="gmail-p1">Thanks</p></div></div>