Diagnosing heap corruption

  • From: Finn Wilcox <finnw@xxxxxxxxxxx>
  • To: LuaJIT mailing list <luajit@xxxxxxxxxxxxx>
  • Date: Fri, 01 Jun 2012 16:17:20 +0100

What is a good way to check the whole heap for corruption?

I am seeing intermittent segfaults, and I suspect a C function and/or a Lua function is overrunning a buffer (allocated with ffi.new.)

valgrind does not report anything, but maybe that is because LuaJIT's own allocator is allocating larger blocks (that are not corrupted) and returning smaller chunks of these from ffi.new?

Other related posts: