memory issue while writing to registrydb

Umesh Singla umeshksingla at macports.org
Mon Jul 10 20:14:50 UTC 2017


Hi

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.

The common error which it gives me is:

----
tclsh8.5(25738,0x7fff9815d3c0) malloc: *** error for object 0x7f8e005023b8:
incorrect checksum for freed object - object was probably modified after
being freed.

*** set a breakpoint in malloc_error_break to debug

----

I tried debugging a lot for over a day but not able to find anything.

Sometimes, it gives me a Segmentation fault or Abort error: 6, all of them
indicating an issue with memory management.

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`.

I am only using vim for development and unable to add any breakpoints and
use GDB since it walks through Tcl.


[1]: https://github.com/umeshksingla/macports-base/tree/gsoc17-migrate

[2]:
https://github.com/umeshksingla/macports-base/blob/gsoc17-migrate/src/cregistry/entry.c#L1422


Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-dev/attachments/20170711/f746c58a/attachment.html>


More information about the macports-dev mailing list