diff options
author | njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2006-09-21 15:59:30 +0000 |
---|---|---|
committer | njn <njn@a5019735-40e9-0310-863c-91ae7b9d1cf9> | 2006-09-21 15:59:30 +0000 |
commit | ba7b458566a91e64cb1b4b989ce39dc13d03e123 (patch) | |
tree | b31e1e3f606fd2e9c2cfc335d7d08d8b72fd44d1 /memcheck/mc_main.c | |
parent | 4ce5e79ff39cbdef678e4bd9d2d16fbaba9f7fde (diff) |
Add a comment about marking static memory as defined.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6083 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'memcheck/mc_main.c')
-rw-r--r-- | memcheck/mc_main.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index 026356b6..98052484 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -2161,6 +2161,16 @@ static void mc_new_mem_startup( Addr a, SizeT len, Bool rr, Bool ww, Bool xx ) { /* Ignore the permissions, just make it defined. Seems to work... */ + // Because code is defined, initialised variables get put in the data + // segment and are defined, and uninitialised variables get put in the + // bss segment and are auto-zeroed (and so defined). + // + // It's possible that there will be padding between global variables. + // This will also be auto-zeroed, and marked as defined by Memcheck. If + // a program uses it, Memcheck will not complain. This is arguably a + // false negative, but it's a grey area -- the behaviour is defined (the + // padding is zeroed) but it's probably not what the user intended. And + // we can't avoid it. DEBUG("mc_new_mem_startup(%p, %llu, rr=%u, ww=%u, xx=%u)\n", a, (ULong)len, rr, ww, xx); MC_(make_mem_defined)(a, len); |