Mail Archives: djgpp-workers/2004/12/10/17:34:07
> Date: Fri, 10 Dec 2004 07:33:03 -0500
> From: CBFalconer <cbfalconer AT yahoo DOT com>
>
> How does it compare to the malldbg package that I built to your
> specifications for nmalloc?
YAMD can catch more bugs, and what's more important, it can catch
them earlier than any tool like malldbg.
What YAMD does is unmap from the address space memory that surrounds
the buffer you get from malloc. So if a program accesses that memory,
e.g., reads or writes beyond the limits of the allocated buffer, it
immediately gets hit with a GPF exception. YAMD catches that
exception and logs it with the traceback, so you can easily see what
code was caught red-handed.
The only limitation of this technique, IIRC, is that you can only
unmap page-aligned regions of memory. This leaves the portion of
memory between the end of the allocated buffer and the next page
unprotected on the hardware level. AFAIK, YAMD uses software
protection for that part (it fills the unallocated memory with magic
bytes), but that is less powerful than the hardware-assisted
protection.
- Raw text -