mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-25 22:40:05 +00:00
Update.
* malloc/malloc.c (_int_free): Add inexpensive double free and memory corruption tests. (malloc_printf_nc): Renamed to malloc_printerr. Second parameter is no format string anymore. Don't use stdio. Adjust all callers. * malloc/hooks.c: Adjust malloc_printf_nc callers.
This commit is contained in:
parent
6bf4302e76
commit
14abadc8bf
@ -6,7 +6,11 @@
|
|||||||
|
|
||||||
* sysdeps/unix/sysv/linux/bits/socket.h (__SCM_CONNECT): Removed.
|
* sysdeps/unix/sysv/linux/bits/socket.h (__SCM_CONNECT): Removed.
|
||||||
|
|
||||||
* malloc/malloc.c (_int_free): Add inexpensive double free test.
|
* malloc/malloc.c (_int_free): Add inexpensive double free and
|
||||||
|
memory corruption tests.
|
||||||
|
(malloc_printf_nc): Renamed to malloc_printerr. Second parameter
|
||||||
|
is no format string anymore. Don't use stdio. Adjust all callers.
|
||||||
|
* malloc/hooks.c: Adjust malloc_printf_nc callers.
|
||||||
|
|
||||||
2004-09-08 Roland McGrath <roland@redhat.com>
|
2004-09-08 Roland McGrath <roland@redhat.com>
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ __malloc_check_init()
|
|||||||
__realloc_hook = realloc_check;
|
__realloc_hook = realloc_check;
|
||||||
__memalign_hook = memalign_check;
|
__memalign_hook = memalign_check;
|
||||||
if(check_action & 1)
|
if(check_action & 1)
|
||||||
malloc_printf_nc (1, "malloc: using debugging hooks\n");
|
malloc_printerr (5, "malloc: using debugging hooks", NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* A simple, standard set of debugging hooks. Overhead is `only' one
|
/* A simple, standard set of debugging hooks. Overhead is `only' one
|
||||||
@ -216,7 +216,7 @@ top_check()
|
|||||||
if((char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem ||
|
if((char*)t + chunksize(t) == mp_.sbrk_base + main_arena.system_mem ||
|
||||||
t == initial_top(&main_arena)) return 0;
|
t == initial_top(&main_arena)) return 0;
|
||||||
|
|
||||||
malloc_printf_nc (check_action, "malloc: top chunk is corrupt\n");
|
malloc_printerr (check_action | 4, "malloc: top chunk is corrupt", NULL);
|
||||||
|
|
||||||
/* Try to set up a new top chunk. */
|
/* Try to set up a new top chunk. */
|
||||||
brk = MORECORE(0);
|
brk = MORECORE(0);
|
||||||
@ -268,7 +268,7 @@ free_check(mem, caller) Void_t* mem; const Void_t *caller;
|
|||||||
if(!p) {
|
if(!p) {
|
||||||
(void)mutex_unlock(&main_arena.mutex);
|
(void)mutex_unlock(&main_arena.mutex);
|
||||||
|
|
||||||
malloc_printf_nc(check_action, "free(): invalid pointer %p!\n", mem);
|
malloc_printerr(check_action, "free(): invalid pointer", mem);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#if HAVE_MMAP
|
#if HAVE_MMAP
|
||||||
@ -302,7 +302,7 @@ realloc_check(oldmem, bytes, caller)
|
|||||||
oldp = mem2chunk_check(oldmem);
|
oldp = mem2chunk_check(oldmem);
|
||||||
(void)mutex_unlock(&main_arena.mutex);
|
(void)mutex_unlock(&main_arena.mutex);
|
||||||
if(!oldp) {
|
if(!oldp) {
|
||||||
malloc_printf_nc(check_action, "realloc(): invalid pointer %p!\n", oldmem);
|
malloc_printerr(check_action, "realloc(): invalid pointer", oldmem);
|
||||||
return malloc_check(bytes, NULL);
|
return malloc_check(bytes, NULL);
|
||||||
}
|
}
|
||||||
oldsize = chunksize(oldp);
|
oldsize = chunksize(oldp);
|
||||||
|
Loading…
Reference in New Issue
Block a user