From: Petar Jovanovic Date: Fri, 3 Feb 2017 01:19:55 +0000 (+0000) Subject: fix leak-segv-jmp test for platforms with 64K pagesize X-Git-Tag: svn/VALGRIND_3_13_0~201 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=16df59b858541c8827a1a45f9a74a93297a42d46;p=thirdparty%2Fvalgrind.git fix leak-segv-jmp test for platforms with 64K pagesize Increase the size of allocated array, so mprotect call does not end up protecting non-allocated areas. This enables the test to work on platforms with pagesize=64K. Issue discovered on MIPS XLP machine with 64K pagesize. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16220 --- diff --git a/memcheck/tests/leak-segv-jmp.c b/memcheck/tests/leak-segv-jmp.c index 1d1f84ca74..86235b7402 100644 --- a/memcheck/tests/leak-segv-jmp.c +++ b/memcheck/tests/leak-segv-jmp.c @@ -287,7 +287,7 @@ void f(void) long pagesize; #define RNDPAGEDOWN(a) ((long)a & ~(pagesize-1)) int i; - const int nr_ptr = (10000 * 4)/sizeof(char*); + const int nr_ptr = (10000 * 20)/sizeof(char*); b10 = calloc (nr_ptr * sizeof(char*), 1); for (i = 0; i < nr_ptr; i++) diff --git a/memcheck/tests/leak-segv-jmp.stderr.exp b/memcheck/tests/leak-segv-jmp.stderr.exp index 1ee37cdf80..f455bd5735 100644 --- a/memcheck/tests/leak-segv-jmp.stderr.exp +++ b/memcheck/tests/leak-segv-jmp.stderr.exp @@ -6,7 +6,7 @@ LEAK SUMMARY: definitely lost: 0 bytes in 0 blocks indirectly lost: 0 bytes in 0 blocks possibly lost: 0 bytes in 0 blocks - still reachable: 41,000 bytes in 2 blocks + still reachable: 201,000 bytes in 2 blocks suppressed: 0 bytes in 0 blocks Reachable blocks (those to which a pointer was found) are not shown. To see them, rerun with: --leak-check=full --show-leak-kinds=all @@ -21,7 +21,7 @@ LEAK SUMMARY: definitely lost: 1,000 bytes in 1 blocks indirectly lost: 0 bytes in 0 blocks possibly lost: 0 bytes in 0 blocks - still reachable: 40,000 bytes in 1 blocks + still reachable: 200,000 bytes in 1 blocks suppressed: 0 bytes in 0 blocks Reachable blocks (those to which a pointer was found) are not shown. To see them, rerun with: --leak-check=full --show-leak-kinds=all @@ -37,7 +37,7 @@ LEAK SUMMARY: definitely lost: 1,000 bytes in 1 blocks indirectly lost: 0 bytes in 0 blocks possibly lost: 0 bytes in 0 blocks - still reachable: 40,000 bytes in 1 blocks + still reachable: 200,000 bytes in 1 blocks suppressed: 0 bytes in 0 blocks Reachable blocks (those to which a pointer was found) are not shown. To see them, rerun with: --leak-check=full --show-leak-kinds=all @@ -53,7 +53,7 @@ LEAK SUMMARY: definitely lost: 1,000 bytes in 1 blocks indirectly lost: 0 bytes in 0 blocks possibly lost: 0 bytes in 0 blocks - still reachable: 40,000 bytes in 1 blocks + still reachable: 200,000 bytes in 1 blocks suppressed: 0 bytes in 0 blocks Reachable blocks (those to which a pointer was found) are not shown. To see them, rerun with: --leak-check=full --show-leak-kinds=all @@ -65,7 +65,7 @@ expecting heuristic not to crash after full mprotect by 0x........: f (leak-segv-jmp.c:295) by 0x........: main (leak-segv-jmp.c:370) -40,000 bytes in 1 blocks are possibly lost in loss record ... of ... +200,000 bytes in 1 blocks are possibly lost in loss record ... of ... at 0x........: calloc (vg_replace_malloc.c:...) by 0x........: f (leak-segv-jmp.c:342) by 0x........: main (leak-segv-jmp.c:370) @@ -73,8 +73,8 @@ expecting heuristic not to crash after full mprotect LEAK SUMMARY: definitely lost: 1,000 bytes in 1 blocks indirectly lost: 0 bytes in 0 blocks - possibly lost: 40,000 bytes in 1 blocks - still reachable: 40,000 bytes in 1 blocks + possibly lost: 200,000 bytes in 1 blocks + still reachable: 200,000 bytes in 1 blocks suppressed: 0 bytes in 0 blocks Reachable blocks (those to which a pointer was found) are not shown. To see them, rerun with: --leak-check=full --show-leak-kinds=all @@ -83,19 +83,19 @@ finished LEAK SUMMARY: definitely lost: 1,000 bytes in 1 blocks indirectly lost: 0 bytes in 0 blocks - possibly lost: 40,000 bytes in 1 blocks - still reachable: 40,000 bytes in 1 blocks + possibly lost: 200,000 bytes in 1 blocks + still reachable: 200,000 bytes in 1 blocks suppressed: 0 bytes in 0 blocks Rerun with --leak-check=full to see details of leaked memory leaked: 1000 bytes in 1 blocks -dubious: 40000 bytes in 1 blocks -reachable: 40000 bytes in 1 blocks +dubious: 200000 bytes in 1 blocks +reachable: 200000 bytes in 1 blocks suppressed: 0 bytes in 0 blocks HEAP SUMMARY: - in use at exit: 81,000 bytes in 3 blocks - total heap usage: 3 allocs, 0 frees, 81,000 bytes allocated + in use at exit: 401,000 bytes in 3 blocks + total heap usage: 3 allocs, 0 frees, 401,000 bytes allocated For a detailed leak analysis, rerun with: --leak-check=full