]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
linux arm regtest: add an expected for leak_cpp_interior
authorPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 16 Feb 2024 20:35:11 +0000 (21:35 +0100)
committerPaul Floyd <pjfloyd@wanadoo.fr>
Fri, 16 Feb 2024 20:35:11 +0000 (21:35 +0100)
For this code

  ptr2 = new MyClass[0]; // "interior but exterior ptr".
  // ptr2 points after the chunk, is wrongly considered by memcheck as definitely leaked.

there's a possible leak rather than a definite one.
I tried adding the clobber macro but that didn't change anything.
So I'm still not too sure why memcheck is finding the pointer for
this.

memcheck/tests/Makefile.am
memcheck/tests/leak_cpp_interior.stderr.exp-arm [new file with mode: 0644]

index 2427bc62a33008c5e0cfca5497a161ce6624c8cd..a60e4b2b453a85d6b2e1865470d4282d2041c5db 100644 (file)
@@ -139,6 +139,8 @@ EXTRA_DIST = \
                cond_st.stderr.exp-64bit-non-arm \
                cond_st.stderr.exp-32bit-non-arm \
        leak_cpp_interior.stderr.exp leak_cpp_interior.stderr.exp-64bit leak_cpp_interior.vgtest libstdc++.supp \
+       leak_cpp_interior.stderr.exp-freebsd leak_cpp_interior.stderr.exp-freebsd-32bit \
+               leak_cpp_interior.stderr.exp-arm \
        custom_alloc.stderr.exp custom_alloc.vgtest \
                custom_alloc.stderr.exp-s390x-mvc \
        custom-overlap.stderr.exp custom-overlap.vgtest \
@@ -446,8 +448,7 @@ EXTRA_DIST = \
        wrapmallocstatic.vgtest wrapmallocstatic.stdout.exp \
        wrapmallocstatic.stderr.exp \
        writev1.stderr.exp writev1.stderr.exp-solaris writev1.vgtest \
-       xml1.stderr.exp xml1.stdout.exp xml1.vgtest xml1.stderr.exp-s390x-mvc \
-       leak_cpp_interior.stderr.exp-freebsd leak_cpp_interior.stderr.exp-freebsd-32bit
+       xml1.stderr.exp xml1.stdout.exp xml1.vgtest xml1.stderr.exp-s390x-mvc
 
 check_PROGRAMS = \
        accounting \
diff --git a/memcheck/tests/leak_cpp_interior.stderr.exp-arm b/memcheck/tests/leak_cpp_interior.stderr.exp-arm
new file mode 100644 (file)
index 0000000..841c2d6
--- /dev/null
@@ -0,0 +1,132 @@
+
+valgrind output will go to log
+VALGRIND_DO_LEAK_CHECK
+x bytes in 1 blocks are definitely lost in loss record ... of ...
+   by 0x........: doit() (leak_cpp_interior.cpp:119)
+   by 0x........: main (leak_cpp_interior.cpp:134)
+
+x bytes in 1 blocks are possibly lost in loss record ... of ...
+   by 0x........: doit() (leak_cpp_interior.cpp:109)
+   by 0x........: main (leak_cpp_interior.cpp:134)
+
+LEAK SUMMARY:
+   definitely lost: x bytes in 1 blocks
+   indirectly lost: 0 bytes in 0 blocks
+     possibly lost: x bytes in 1 blocks
+   still reachable: x bytes in 8 blocks
+                      of which reachable via heuristic:
+                        stdstring          : x bytes in 2 blocks
+                        length64           : x bytes in 1 blocks
+                        multipleinheritance: x bytes in 2 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
+
+leak_check summary heuristics multipleinheritance
+LEAK SUMMARY:
+   definitely lost: x (+0) bytes in 1 (+0) blocks
+   indirectly lost: 0 (+0) bytes in 0 (+0) blocks
+     possibly lost: x (+x) bytes in 4 (+3) blocks
+   still reachable: x (-x) bytes in 5 (-3) blocks
+                      of which reachable via heuristic:
+                        stdstring          : 0 (-x) bytes in 0 (-2) blocks
+                        length64           : 0 (-x) bytes in 0 (-1) blocks
+                        multipleinheritance: x (+0) bytes in 2 (+0) blocks
+To see details of leaked memory, give 'full' arg to leak_check
+
+leak_check summary any heuristics newarray
+LEAK SUMMARY:
+   definitely lost: x (+0) bytes in 1 (+0) blocks
+   indirectly lost: 0 (+0) bytes in 0 (+0) blocks
+     possibly lost: x (+x) bytes in 6 (+2) blocks
+   still reachable: x (-x) bytes in 3 (-2) blocks
+                      of which reachable via heuristic:
+                        multipleinheritance: 0 (-x) bytes in 0 (-2) blocks
+To see details of leaked memory, give 'full' arg to leak_check
+
+leak_check summary heuristics length64
+LEAK SUMMARY:
+   definitely lost: x (+0) bytes in 1 (+0) blocks
+   indirectly lost: 0 (+0) bytes in 0 (+0) blocks
+     possibly lost: x (-x) bytes in 5 (-1) blocks
+   still reachable: x (+x) bytes in 4 (+1) blocks
+                      of which reachable via heuristic:
+                        length64           : x (+x) bytes in 1 (+1) blocks
+To see details of leaked memory, give 'full' arg to leak_check
+
+leak_check summary heuristics stdstring
+LEAK SUMMARY:
+   definitely lost: x (+0) bytes in 1 (+0) blocks
+   indirectly lost: 0 (+0) bytes in 0 (+0) blocks
+     possibly lost: x (-x) bytes in 4 (-1) blocks
+   still reachable: x (+x) bytes in 5 (+1) blocks
+                      of which reachable via heuristic:
+                        stdstring          : x (+x) bytes in 2 (+2) blocks
+                        length64           : 0 (-x) bytes in 0 (-1) blocks
+To see details of leaked memory, give 'full' arg to leak_check
+
+leak_check summary heuristics multipleinheritance,newarray,stdstring,length64
+LEAK SUMMARY:
+   definitely lost: x (+0) bytes in 1 (+0) blocks
+   indirectly lost: 0 (+0) bytes in 0 (+0) blocks
+     possibly lost: x (-x) bytes in 1 (-3) blocks
+   still reachable: x (+x) bytes in 8 (+3) blocks
+                      of which reachable via heuristic:
+                        stdstring          : x (+0) bytes in 2 (+0) blocks
+                        length64           : x (+x) bytes in 1 (+1) blocks
+                        multipleinheritance: x (+x) bytes in 2 (+2) blocks
+To see details of leaked memory, give 'full' arg to leak_check
+
+leak_check summary heuristics all
+LEAK SUMMARY:
+   definitely lost: x (+0) bytes in 1 (+0) blocks
+   indirectly lost: 0 (+0) bytes in 0 (+0) blocks
+     possibly lost: x (+0) bytes in 1 (+0) blocks
+   still reachable: x (+0) bytes in 8 (+0) blocks
+                      of which reachable via heuristic:
+                        stdstring          : x (+0) bytes in 2 (+0) blocks
+                        length64           : x (+0) bytes in 1 (+0) blocks
+                        multipleinheritance: x (+0) bytes in 2 (+0) blocks
+To see details of leaked memory, give 'full' arg to leak_check
+
+leak_check summary heuristics none
+LEAK SUMMARY:
+   definitely lost: x (+0) bytes in 1 (+0) blocks
+   indirectly lost: 0 (+0) bytes in 0 (+0) blocks
+     possibly lost: x (+x) bytes in 6 (+5) blocks
+   still reachable: x (-x) bytes in 3 (-5) blocks
+                      of which reachable via heuristic:
+                        stdstring          : 0 (-x) bytes in 0 (-2) blocks
+                        length64           : 0 (-x) bytes in 0 (-1) blocks
+                        multipleinheritance: 0 (-x) bytes in 0 (-2) blocks
+To see details of leaked memory, give 'full' arg to leak_check
+
+Searching for pointers pointing in x bytes from 0x........
+*0x........ interior points at x bytes inside 0x........
+ Address 0x........ is 0 bytes inside data symbol "ptr"
+Searching for pointers pointing in x bytes from 0x........
+*0x........ interior points at x bytes inside 0x........
+ Address 0x........ is 0 bytes inside data symbol "ptr"
+destruct MyClass
+destruct MyClass
+destruct MyClass
+destruct Ce
+destruct Be
+destruct Ae
+destruct Ce
+destruct Be
+destruct Ae
+destruct C
+destruct B
+destruct A
+destruct C
+destruct B
+destruct A
+Finished!
+
+HEAP SUMMARY:
+    in use at exit: 0 bytes in 0 blocks
+
+All heap blocks were freed -- no leaks are possible
+
+For lists of detected and suppressed errors, rerun with: -s
+ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)