I'm using Boehm GC and valgrind.

But it seems valgrind cannot detect overflow in GC_malloc'ed buffers.

Does anyone know any tools that can detect buffer overflow for Boehm GC?

  • The programmer? Your code should check for the buffer limits before writing to that buffer rather than relying on a tool to catch it for you. May 3 '15 at 4:59
  • 3
    And then there would be no need for tools like Valgrind, Boehm, et al? Welcome to the real world. May 4 '15 at 12:06
  • Boehm GC is available for Linux only, right? So any Windows tools do not match your criteria. Sep 7 '15 at 9:27

Our CheckPointer tool may be able to do what you want.

You didn't specifically say how valgrind failed, only that it did. It is known that valgrind cannot detect certain kinds of memory access errors. It certainly can't detect buffer overflows for a buffer within a struct or a buffer allocated in local stack space, because it doesn't have any knowledge of the size of those buffers. The area around the buffer is by definition valid data space and so accesses are "valid" from valgrind's point of view, even if it is off the edge of the buffer.

In contrast, CheckPointer reads your C source code and collects information about the data types (and therefore their sizes). This gives it the key information needed to do that detection. After collection of type information, it then instruments the code to watch for errors in memory access. It will catch the above errors, and a wide variety of others.

CheckPointer presently is only available for C.

This is a product of my company, so don't take this as a recommendation. I'm merely documenting that it exists and apparantly matches your requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.