4 ms·
Is this really different from the glibc malloc() implementation with MALLOC_CHECK_ set to 3? > MALLOC_CHECK_ is designed to be tolerant against simple errors,
by Spider 15y ago
Is this really different from the glibc malloc() implementation with MALLOC_CHECK_ set to 3?
> MALLOC_CHECK_ is designed to be tolerant against simple errors, such as double calls of free() with the same argument, or overruns of a single byte (off-by-one bugs). Not all such errors can be protected against, however, and memory leaks can result.
> If MALLOC_CHECK_ is set to 0, any detected heap corruption is silently ignored;
> if set to 1, a diagnostic message is printed on stderr;
> if set to 2, abort(3) is called immediately;
> if set to 3, a diagnostic message is printed on stderr and the program is aborted.
- marshray 15y agoYes, the OpenBSD technique of completely unmapping the memory rather than re-using it will be able to catch even some read accesses, not just write accesses that happen to corrupt malloc's guards.