[ovs-dev] [PATCH] tests: Add track-origins flag to valgrind.

Ilya Maximets i.maximets at samsung.com
Tue Sep 3 15:07:26 UTC 2019


Useful for tracking where the uninitialized memory came from.
Report example:

  Thread 13 revalidator11:
  Conditional jump or move depends on uninitialised value(s)
     at 0x4C35D96: __memcmp_sse4_1 (in vgpreload_memcheck.so)
     by 0x9D4404: ofpbuf_equal (ofpbuf.h:273)
     by 0x9D4404: revalidate_ukey__ (ofproto-dpif-upcall.c:2219)
     <...>
     by 0x6AF488E: clone (clone.S:95)
   Uninitialised value was created by a stack allocation
     at 0x9D4450: compose_slow_path (ofproto-dpif-upcall.c:1062)

Signed-off-by: Ilya Maximets <i.maximets at samsung.com>
---
 tests/automake.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tests/automake.mk b/tests/automake.mk
index d6ab51732..908eb6666 100644
--- a/tests/automake.mk
+++ b/tests/automake.mk
@@ -264,7 +264,8 @@ $(valgrind_wrappers): tests/valgrind-wrapper.in
 CLEANFILES += $(valgrind_wrappers)
 EXTRA_DIST += tests/valgrind-wrapper.in
 
-VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
+VALGRIND = valgrind --log-file=valgrind.%p \
+	--leak-check=full --track-origins=yes \
 	--suppressions=$(abs_top_srcdir)/tests/glibc.supp \
 	--suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
 HELGRIND = valgrind --log-file=helgrind.%p --tool=helgrind \
-- 
2.17.1



More information about the dev mailing list