From: Julian Seward Date: Sat, 24 Nov 2007 23:37:07 +0000 (+0000) Subject: Attempt to shake out uses of uninitialised malloc'd memory by Valgrind X-Git-Tag: svn/VALGRIND_3_3_0~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1cd71d2ca90271fe4db9da9fa1d6ef72e35926f;p=thirdparty%2Fvalgrind.git Attempt to shake out uses of uninitialised malloc'd memory by Valgrind itself, if such exist. Attempt failed (or no such uses exist :-) Commit does not change any code. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7207 --- diff --git a/coregrind/m_mallocfree.c b/coregrind/m_mallocfree.c index 47ce7cc1b4..0381092e65 100644 --- a/coregrind/m_mallocfree.c +++ b/coregrind/m_mallocfree.c @@ -1222,7 +1222,17 @@ void* VG_(arena_malloc) ( ArenaId aid, SizeT req_pszB ) v = get_block_payload(a, b); vg_assert( (((Addr)v) & (VG_MIN_MALLOC_SZB-1)) == 0 ); - //zzVALGRIND_MALLOCLIKE_BLOCK(v, req_pszB, 0, False); + /* VALGRIND_MALLOCLIKE_BLOCK(v, req_pszB, 0, False); */ + + /* For debugging/testing purposes, fill the newly allocated area + with a definite value in an attempt to shake out any + uninitialised uses of the data (by V core / V tools, not by the + client). Testing on 25 Nov 07 with the values 0x00, 0xFF, 0x55, + 0xAA showed no differences in the regression tests on + amd64-linux. Note, is disabled by default. */ + if (0 && aid != VG_AR_CLIENT) + VG_(memset)(v, 0xAA, (SizeT)req_pszB); + return v; }