[Antik-devel] Memory corruption when loading an SBCL core containing antik (patch included)

James Wright james at chumsley.org
Fri Dec 9 20:39:01 UTC 2011


Hi,

When I dump an SBCL core from an image that has antik loaded, I get a
memory corruption error when loading the core:
  *** glibc detected *** sbcl: free(): invalid pointer: 0x0808d588 ***
This happens even with a minimal project that does nothing but load
antik; I've attached a script to reproduce the problem.

I did some investigation, and it looks like the problem is the
`*formatting-test-grid*' variable in `format-grid.lisp'.  It contains
a list of grids, including some foreign arrays.  Presumably the
foreign pointers in these arrays will be pointing to random/unowned
memory when the core is loaded.  I've run into similar problems before
in my own code (attempting to dump a global `*rng*' variable that
contained a GSLL random number generator).

I've attached a patch that replaces the problem `defparameter' form
with a function instead.  I can't find any references to this variable
in the source tree, so I assume it's just there for manual testing.

Thanks,
      James
-------------- next part --------------
A non-text attachment was scrubbed...
Name: repro-antik-corruption.sh
Type: application/x-sh
Size: 579 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/antik-devel/attachments/20111209/850a8035/attachment.sh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Convert-variable-all-formatting-test-grids-into-a-fu.patch
Type: text/x-patch
Size: 1527 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/antik-devel/attachments/20111209/850a8035/attachment.bin>


More information about the antik-devel mailing list