Discussion:
Valgrind: r16220 - in /trunk/memcheck/tests: leak-segv-jmp.c leak-segv-jmp.stderr.exp
(too old to reply)
s***@valgrind.org
2017-02-03 01:19:55 UTC
Permalink
Raw Message
Author: petarj
Date: Fri Feb 3 01:19:55 2017
New Revision: 16220

Log:
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.

Modified:
trunk/memcheck/tests/leak-segv-jmp.c
trunk/memcheck/tests/leak-segv-jmp.stderr.exp

Modified: trunk/memcheck/tests/leak-segv-jmp.c
==============================================================================
--- trunk/memcheck/tests/leak-segv-jmp.c (original)
+++ trunk/memcheck/tests/leak-segv-jmp.c Fri Feb 3 01:19:55 2017
@@ -287,7 +287,7 @@
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++)

Modified: trunk/memcheck/tests/leak-segv-jmp.stderr.exp
==============================================================================
--- trunk/memcheck/tests/leak-segv-jmp.stderr.exp (original)
+++ trunk/memcheck/tests/leak-segv-jmp.stderr.exp Fri Feb 3 01:19:55 2017
@@ -6,7 +6,7 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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

Loading...