From: Nicholas Nethercote Date: Sun, 15 Mar 2009 23:59:13 +0000 (+0000) Subject: Merge r9419 (make describe-block portable) from the DARWIN branch. X-Git-Tag: svn/VALGRIND_3_5_0~850 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=02c66cc57fa14299f692a6361c4d7b14d2028fd9;p=thirdparty%2Fvalgrind.git Merge r9419 (make describe-block portable) from the DARWIN branch. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@9420 --- diff --git a/memcheck/tests/describe-block.c b/memcheck/tests/describe-block.c index 890db9a9b5..1cbd3b16c5 100644 --- a/memcheck/tests/describe-block.c +++ b/memcheck/tests/describe-block.c @@ -2,7 +2,9 @@ int main() { - VALGRIND_CREATE_BLOCK(0x1000, 0x1000, "magic foople zone"); - *(char *)0x1000 = 'x'; - return 0; + char magic_foople_zone[0x1000]; + VALGRIND_CREATE_BLOCK(magic_foople_zone, 0x1000, "magic foople zone"); + VALGRIND_MAKE_MEM_NOACCESS(magic_foople_zone, 0x1000); + magic_foople_zone[0] = 'x'; + return 0; } diff --git a/memcheck/tests/describe-block.stderr.exp b/memcheck/tests/describe-block.stderr.exp index a66b106444..619931e2b8 100644 --- a/memcheck/tests/describe-block.stderr.exp +++ b/memcheck/tests/describe-block.stderr.exp @@ -1,16 +1,8 @@ Invalid write of size 1 - at 0x........: main (describe-block.c:6) + at 0x........: main (describe-block.c:8) Address 0x........ is 0 bytes inside a magic foople zone of size 4,096 client-defined - at 0x........: main (describe-block.c:5) - -Process terminating with default action of signal 11 (SIGSEGV) - Access not within mapped region at address 0x........ at 0x........: main (describe-block.c:6) - If you believe this happened as a result of a stack overflow in your - program's main thread (unlikely but possible), you can try to increase - the size of the main thread stack using the --main-stacksize= flag. - The main thread stack size used in this run was .... ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) malloc/free: in use at exit: ... bytes in ... blocks.