Ported over the kernel heap to libroot to make use of it's validation
capabilities to aid in debugging memory corruption issues. It does: * Initialize memory to 0xcc to help turn up use of uninitialized memory * Set freed memory to 0xdeadbeef to help find accesses of freed memory * Use the paranoid heap validation to turn up many cases of memory corruption * Use a simplistic wall check to turn up memory overwrites past allocations * Take extra steps to validate freed addresses to turn up misaligned frees It has an interface to en-/disable paranoid validation and to start/stop regular wall checking. Both are currently just enabled. At a later stage a debug version of libroot could be used by an application and the checks enabled at will. Note that due to the paranoid validation and the suboptimal locking this allocator will perform horribly. Still to find memory corruption issues in the system or also in your applications it can be helpful to build your installation with it turned on. To enable it you currently need to edit the Jamfile to sub-include the malloc_debug instead of the malloc directory. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32894 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
74e8797f5e
commit
185fd1c5d2
@ -34,6 +34,7 @@ SubInclude HAIKU_TOP src system libroot posix arch $(TARGET_ARCH) ;
|
||||
SubInclude HAIKU_TOP src system libroot posix crypt ;
|
||||
SubInclude HAIKU_TOP src system libroot posix locale ;
|
||||
SubInclude HAIKU_TOP src system libroot posix malloc ;
|
||||
#SubInclude HAIKU_TOP src system libroot posix malloc_debug ;
|
||||
SubInclude HAIKU_TOP src system libroot posix pthread ;
|
||||
SubInclude HAIKU_TOP src system libroot posix signal ;
|
||||
SubInclude HAIKU_TOP src system libroot posix stdio ;
|
||||
|
7
src/system/libroot/posix/malloc_debug/Jamfile
Normal file
7
src/system/libroot/posix/malloc_debug/Jamfile
Normal file
@ -0,0 +1,7 @@
|
||||
SubDir HAIKU_TOP src system libroot posix malloc_debug ;
|
||||
|
||||
UsePrivateSystemHeaders ;
|
||||
|
||||
MergeObject posix_malloc.o :
|
||||
heap.cpp
|
||||
;
|
1753
src/system/libroot/posix/malloc_debug/heap.cpp
Normal file
1753
src/system/libroot/posix/malloc_debug/heap.cpp
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user