mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-04 02:18:37 +00:00
use a custom-allocator and detect almost as many errors as you could detect if you used malloc/new/new[]. (eg. leaks detected, free errors, free mismatch, etc). Had to fiddle with mac_malloc_wrappers.c a bit to factor out the appropriate code to be called from the client request handling code. Also had to add a new element `MAC_AllocCustom' to the MAC_AllocKind type. Also added a little documentation, and a regression test. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1643
45 lines
1.8 KiB
Plaintext
45 lines
1.8 KiB
Plaintext
|
|
Invalid write of size 4
|
|
at 0x........: main (custom_alloc.c:79)
|
|
by 0x........: __libc_start_main (...libc...)
|
|
by 0x........: ...
|
|
Address 0x........ is 48 bytes inside a block of size 100000 client-defined
|
|
at 0x........: get_superblock (custom_alloc.c:25)
|
|
by 0x........: custom_alloc (custom_alloc.c:40)
|
|
by 0x........: main (custom_alloc.c:76)
|
|
by 0x........: __libc_start_main (...libc...)
|
|
|
|
Invalid free() / delete / delete[]
|
|
at 0x........: custom_free (custom_alloc.c:54)
|
|
by 0x........: main (custom_alloc.c:83)
|
|
by 0x........: __libc_start_main (...libc...)
|
|
by 0x........: ...
|
|
Address 0x........ is not stack'd, malloc'd or free'd
|
|
|
|
Mismatched free() / delete / delete []
|
|
at 0x........: custom_free (custom_alloc.c:54)
|
|
by 0x........: main (custom_alloc.c:86)
|
|
by 0x........: __libc_start_main (...libc...)
|
|
by 0x........: ...
|
|
Address 0x........ is 0 bytes inside a block of size 40 alloc'd
|
|
at 0x........: malloc (vg_replace_malloc.c:...)
|
|
by 0x........: main (custom_alloc.c:85)
|
|
by 0x........: __libc_start_main (...libc...)
|
|
by 0x........: ...
|
|
|
|
Invalid read of size 4
|
|
at 0x........: main (custom_alloc.c:89)
|
|
by 0x........: __libc_start_main (...libc...)
|
|
by 0x........: ...
|
|
Address 0x........ is 8 bytes inside a block of size 100000 client-defined
|
|
at 0x........: get_superblock (custom_alloc.c:25)
|
|
by 0x........: custom_alloc (custom_alloc.c:40)
|
|
by 0x........: main (custom_alloc.c:76)
|
|
by 0x........: __libc_start_main (...libc...)
|
|
|
|
ERROR SUMMARY: 4 errors from 4 contexts (suppressed: 0 from 0)
|
|
malloc/free: in use at exit: 40 bytes in 1 blocks.
|
|
malloc/free: 3 allocs, 3 frees, 120 bytes allocated.
|
|
For a detailed leak analysis, rerun with: --leak-check=yes
|
|
For counts of detected errors, rerun with: -v
|