diff --git a/coregrind/docs/coregrind_core.html b/coregrind/docs/coregrind_core.html index edf4d49a9..e1cbc06a2 100644 --- a/coregrind/docs/coregrind_core.html +++ b/coregrind/docs/coregrind_core.html @@ -327,6 +327,11 @@ This is useful if part of your project contains errors you can't or don't want to fix, yet you don't want to continuously be reminded of them. +
+Note: By far the easiest way to add suppressions is to use the
+--gen-suppressions=yes flag described in this
+section.
+
Each error to be suppressed is described very specifically, to minimise the possibility that a suppression-directive inadvertantly @@ -345,6 +350,122 @@ number of times it got used. Here's the suppressions used by a run of --27579-- supp: 6 strrchr/_dl_map_object_from_fd/_dl_map_object +
+Multiple suppressions files are allowed. By default, Valgrind uses
+$PREFIX/lib/valgrind/default.supp. You can ask to add
+suppressions from another file, by specifying
+--suppressions=/path/to/file.supp.
+
+
+If you want to understand more about suppressions, look at an existing
+suppressions file whilst reading the following documentation. The file
+glibc-2.2.supp, in the source distribution, provides some good
+examples.
+
+
Each suppression has the following components:
+
+ +
+ skin_name1,skin_name2:suppression_name ++ (Nb: no spaces are allowed). +
+ Recall that valgrind-2.0.X is a modular system, in which + different instrumentation tools can observe your program whilst + it is running. Since different tools detect different kinds of + errors, it is necessary to say which skin(s) the suppression is + meaningful to. +
+ Skins will complain, at startup, if a skin does not understand + any suppression directed to it. Skins ignore suppressions which + are not directed to them. As a result, it is quite practical to + put suppressions for all skins into the same suppression file. +
+ Valgrind's core can detect certain PThreads API errors, for which this + line reads: +
+ core:PThread ++ +
Param suppression for
+ Memcheck)+ +
+ Locations may be either names of shared objects/executables or wildcards
+ matching function names. They begin obj: and
+ fun: respectively. Function and object names to match
+ against may use the wildcard characters * and
+ ?.
+
+ Important note: C++ function names must be mangled. If
+ you are writing suppressions by hand, use the --demangle=no
+ option to get the mangled names in your error messages.
+
+ +
+ +A suppression only suppresses an error when the error matches all the +details in the suppression. Here's an example: +
+ {
+ __gconv_transform_ascii_internal/__mbrtowc/mbtowc
+ Memcheck:Value4
+ fun:__gconv_transform_ascii_internal
+ fun:__mbr*toc
+ fun:mbtowc
+ }
+
+
+What is means is: in the Memcheck skin only, suppress a
+use-of-uninitialised-value error, when the data size is 4, when it
+occurs in the function __gconv_transform_ascii_internal,
+when that is called from any function of name matching
+__mbr*toc, when that is called from mbtowc.
+It doesn't apply under any other circumstances. The string by which
+this suppression is identified to the user is
+__gconv_transform_ascii_internal/__mbrtowc/mbtowc.
+
+(See this section for more details on +the specifics of Memcheck's suppression kinds.) + +
Another example, again for the Memcheck skin: +
+ {
+ libX11.so.6.2/libX11.so.6.2/libXaw.so.7.0
+ Memcheck:Value4
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libX11.so.6.2
+ obj:/usr/X11R6/lib/libXaw.so.7.0
+ }
+
+
+Suppress any size 4 uninitialised-value error which occurs anywhere
+in libX11.so.6.2, when called from anywhere in the same
+library, when called from anywhere in libXaw.so.7.0. The
+inexact specification of locations is regrettable, but is about all
+you can hope for, given that the X11 libraries shipped with Red Hat
+7.2 have had their symbol tables removed.
+
+
Note -- since the above two examples did not make it clear -- that
+you can freely mix the obj: and fun:
+styles of description within a single suppression record.
+
-A suppression file describes a bunch of errors which, for one reason
-or another, you don't want Valgrind to tell you about. Usually the
-reason is that the system libraries are buggy but unfixable, at least
-within the scope of the current debugging session. Multiple
-suppressions files are allowed. By default, Valgrind uses
-$PREFIX/lib/valgrind/default.supp.
-
-
-You can ask to add suppressions from another file, by specifying
---suppressions=/path/to/file.supp.
-
-
-A good way to get started writing your own suppressions is to
-look at an existing suppressions file whilst reading the following
-documentation. The file glibc-2.2.supp, in the source
-distribution, provides some good examples.
-
-
Each suppression has the following components:
-
- -
- Skins will complain, at startup, if a skin does not understand - any suppression directed to it. Skins ignore suppressions which - are not directed to them. As a result, it is quite practical to - put suppressions for all skins into the same suppression file. -
- A suppression indicates the skins it is intended for by listing - their names, separated by commas, then a colon. No spaces are - allowed, since our parser is very inflexible. An example is: -
- Addrcheck,Memcheck: -- meaning that the suppression is intended for both the Memcheck - and the Addrcheck skins. -
- -
Value1,
- Value2,
- Value4 or
- Value8,
- meaning an uninitialised-value error when
- using a value of 1, 2, 4 or 8 bytes.
- Or
- Cond (or its old name, Value0),
- meaning use of an uninitialised CPU condition code. Or:
- Addr1,
- Addr2,
- Addr4 or
- Addr8, meaning an invalid address during a
- memory access of 1, 2, 4 or 8 bytes respectively. Or
- Param,
- meaning an invalid system call parameter error. Or
- Free, meaning an invalid or mismatching free.
- Overlap, meaning a src/dst
- overlap in memcpy() or a similar function.
- Or PThread, meaning any kind of complaint to do
- with the PThreads API.
-
- Last but not least,
- you can suppress leak reports with Leak. Leak
- suppression was added in valgrind-1.9.3, I believe.
-
- -
free, __builtin_vec_delete, etc).
- For Overlap errors, is the name of the function with the overlapping
- arguments (eg. memcpy(), strcpy(), etc).
- - -
- -
-Locations may be either names of shared objects/executables or wildcards
-matching function names. They begin obj: and fun:
-respectively. Function and object names to match against may use the
-wildcard characters * and ?.
-
-A suppression only suppresses an error when the error matches all the
-details in the suppression. Here's an example:
+The suppression (2nd) line should have the form:
- {
- __gconv_transform_ascii_internal/__mbrtowc/mbtowc
- Memcheck:Value4
- fun:__gconv_transform_ascii_internal
- fun:__mbr*toc
- fun:mbtowc
- }
+Memcheck:suppression_type
+
+Or, since some of the suppressions are shared with the Addrcheck skin:
++Memcheck,Addrcheck:suppression_type-
What is means is: in the Memcheck skin only, suppress a
-use-of-uninitialised-value error, when the data size is 4, when it
-occurs in the function __gconv_transform_ascii_internal,
-when that is called from any function of name matching
-__mbr*toc, when that is called from mbtowc.
-It doesn't apply under any other circumstances. The string by which
-this suppression is identified to the user is
-__gconv_transform_ascii_internal/__mbrtowc/mbtowc.
-
-
Another example, again for the Memcheck skin: -
- {
- libX11.so.6.2/libX11.so.6.2/libXaw.so.7.0
- Memcheck:Value4
- obj:/usr/X11R6/lib/libX11.so.6.2
- obj:/usr/X11R6/lib/libX11.so.6.2
- obj:/usr/X11R6/lib/libXaw.so.7.0
- }
-
-
-Suppress any size 4 uninitialised-value error which occurs anywhere
-in libX11.so.6.2, when called from anywhere in the same
-library, when called from anywhere in libXaw.so.7.0. The
-inexact specification of locations is regrettable, but is about all
-you can hope for, given that the X11 libraries shipped with Red Hat
-7.2 have had their symbol tables removed.
-
-
Note -- since the above two examples did not make it clear -- that
-you can freely mix the obj: and fun:
-styles of description within a single suppression record.
-
-
-
+
+The Memcheck suppression types are as follows:
+Value1,
+Value2,
+Value4 or
+Value8,
+meaning an uninitialised-value error when
+using a value of 1, 2, 4 or 8 bytes.
+Or
+Cond (or its old name, Value0),
+meaning use of an uninitialised CPU condition code. Or:
+Addr1,
+Addr2,
+Addr4 or
+Addr8, meaning an invalid address during a
+memory access of 1, 2, 4 or 8 bytes respectively. Or
+Param,
+meaning an invalid system call parameter error. Or
+Free, meaning an invalid or mismatching free.
+Overlap, meaning a src/dst
+overlap in memcpy() or a similar function. Last but not least,
+you can suppress leak reports with Leak. Leak suppression was
+added in valgrind-1.9.3, I believe.
+
+The extra information line: for Param errors, is the name of the offending +system call parameter. +No other error kinds have this extra line. +
+The first line of the calling context: for Value and Addr errors, it is either
+the name of the function in which the error occurred, or, failing that, the
+full path of the .so file or executable containing the error location. For
+Free errors, is the name of the function doing the freeing (eg,
+free, __builtin_vec_delete, etc). For Overlap
+errors, is the name of the function with the overlapping arguments (eg.
+memcpy(), strcpy(), etc).
+
+Lastly, there's the rest of the calling context. +