MEDIUM: memory: add the ability to poison memory at run time
authorWilly Tarreau <w@1wt.eu>
Tue, 8 May 2012 13:40:42 +0000 (15:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 8 May 2012 19:28:16 +0000 (21:28 +0200)
commit6e0644339f3bcd455693d45219ba80ec23226296
tree6860adc1cd401287dc898e32881ea7e9fb4e2459
parent63e7fe310ef50625faeecb2fa41fa3914a24f577
MEDIUM: memory: add the ability to poison memory at run time

From time to time, some bugs are discovered that are caused by non-initialized
memory areas. It happens that most platforms return a zero-filled area upon
first malloc() thus hiding potential bugs. This patch also replaces malloc()
in pools with calloc() to ensure that all platforms exhibit the same behaviour
upon startup. In order to catch these bugs more easily, add a -dM command line
flag to enable memory poisonning. Optionally, passing -dM<byte> forces the
poisonning byte to <byte>.
include/common/memory.h
src/haproxy.c
src/memory.c