Hi,

From: Otto Moerbeek <o...@drijf.net>
Date: Fri, 11 Dec 2020 08:54:36 +0100

> Hi,
> 
> I did some basic testing of valgrind on amd64 and it seems to be in
> better shape than before, at least for memory leak detection.
> 
> But I do seem to get a report on every syscall done. One example:
> 
> ==7218== Use of uninitialised value of size 8
> ==7218==    at 0x4A7670E: write (sys/w_write.c:28)
> ==7218==    by 0x4A40F52: __sflush (stdio/fflush.c:80)
> ==7218==    by 0x4A94726: __sfvwrite (stdio/fvwrite.c:191)
> ==7218==    by 0x4ACCA68: __sprint (stdio/vfprintf.c:111)
> ==7218==    by 0x4ACCA68: __vfprintf (stdio/vfprintf.c:1107)
> ==7218==    by 0x4AC8851: vfprintf (stdio/vfprintf.c:266)
> ==7218==    by 0x4A7C8A0: printf (stdio/printf.c:44)
> ==7218==    by 0x109AB8: main (x.c:14)
> 
> Is there a way to avoid this? If so, it would be nice to mention that
> in a pkg-readme.
> 
>       -Otto

Do you want somethig like this?

$ cvs -q diff .
Index: devel/valgrind/pkg-readme
===================================================================
RCS file: devel/valgrind/pkg-readme
diff -N devel/valgrind/pkg-readme
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ devel/valgrind/pkg-readme   14 Dec 2020 05:18:59 -0000
@@ -0,0 +1,23 @@
+Suppressiong errors
+
+If you got a report on every syscall done as followes:
+
+==67551== Use of uninitialised value of size 8
+==67551==    at 0x4AC08F9: write (sys/w_write.c:26)
+==67551==    by 0x4A5AC12: __sflush (stdio/fflush.c:80)
+==67551==    by 0x4A4C676: __sfvwrite (stdio/fvwrite.c:191)
+==67551==    by 0x4A80CD8: __sprint (stdio/vfprintf.c:111)
+==67551==    by 0x4A80CD8: __vfprintf (stdio/vfprintf.c:1107)
+==67551==    by 0x4A7CAC1: vfprintf (stdio/vfprintf.c:266)
+==67551==    by 0x4A54680: printf (stdio/printf.c:44)
+==67551==    by 0x109BA5: main (main.c:19)
+
+You can use --gen-suppressions=yes and --suppressions=FILENAME
options of
+valgrind.
+
+    $ yes | valgrind --gen-suppressions=yes ./a.out 2>supress.txt 
+    $ sed -e '/^==.*[^{]$/d' -e 's/==.*{/{/' supress.log >
supress.txt
+    $ valgrind --suppressions=supress.txt ./a.out
+
+See also:
+https://www.valgrind.org/docs/manual/manual-core.html#manual-core.suppress
--
ASOU Masato

Reply via email to