faster backtrace; show predecessor blocks on block overflow

This commit is contained in:
Daan 2021-12-10 17:16:37 -08:00
parent b6e2b6e975
commit 5739714b8d
4 changed files with 20 additions and 16 deletions

View file

@ -62,7 +62,8 @@ int main() {
static void invalid_free() {
free((void*)0xBADBEEF);
realloc((void*)0xBADBEEF,10);
void* p = realloc((void*)0xBADBEEF,10);
free(p);
}
static void block_overflow1() {
@ -165,7 +166,7 @@ static void corrupt_free2() {
// allocate more.. trying to trigger an allocation from a corrupted entry
// this may need many allocations to get there (if at all)
for (int i = 0; i < 4096; i++) {
malloc(SZ);
void* p = malloc(SZ);
}
// free the rest
for (int i = 0; i < N; i++) {