blob: d0c23547b72e500552b2a2e92548dfd3148aa8be [file] [log] [blame]
Elliott Hughesa0664b92017-04-18 17:46:52 -07001'\" t
2.\" Title: VALGRIND
3.\" Author: [see the "Author" section]
4.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
5.\" Date: 10/21/2016
6.\" Manual: Release 3.12.0
7.\" Source: Release 3.12.0
8.\" Language: English
9.\"
10.TH "VALGRIND" "1" "10/21/2016" "Release 3.12.0" "Release 3.12.0"
11.\" -----------------------------------------------------------------
12.\" * Define some portability stuff
13.\" -----------------------------------------------------------------
14.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
15.\" http://bugs.debian.org/507673
16.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
17.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
18.ie \n(.g .ds Aq \(aq
19.el .ds Aq '
20.\" -----------------------------------------------------------------
21.\" * set default formatting
22.\" -----------------------------------------------------------------
23.\" disable hyphenation
24.nh
25.\" disable justification (adjust text to left margin only)
26.ad l
27.\" -----------------------------------------------------------------
28.\" * MAIN CONTENT STARTS HERE *
29.\" -----------------------------------------------------------------
30.SH "NAME"
31valgrind \- a suite of tools for debugging and profiling programs
32.SH "SYNOPSIS"
33.HP \w'\fBvalgrind\fR\ 'u
34\fBvalgrind\fR [\fIvalgrind\-options\fR] [\fByour\-program\fR] [\fIyour\-program\-options\fR]
35.SH "DESCRIPTION"
36.PP
37\fBValgrind\fR
38is a flexible program for debugging and profiling Linux executables\&. It consists of a core, which provides a synthetic CPU in software, and a series of debugging and profiling tools\&. The architecture is modular, so that new tools can be created easily and without disturbing the existing structure\&.
39.PP
40Some of the options described below work with all Valgrind tools, and some only work with a few or one\&. The section MEMCHECK OPTIONS and those below it describe tool\-specific options\&.
41.PP
42This manual page covers only basic usage and options\&. For more comprehensive information, please see the HTML documentation on your system:
43$INSTALL/share/doc/valgrind/html/index\&.html, or online:
44http://www\&.valgrind\&.org/docs/manual/index\&.html\&.
45.SH "TOOL SELECTION OPTIONS"
46.PP
47The single most important option\&.
48.PP
49\fB\-\-tool=<toolname> [default: memcheck] \fR
50.RS 4
51Run the Valgrind tool called
52\fItoolname\fR, e\&.g\&. memcheck, cachegrind, callgrind, helgrind, drd, massif, lackey, none, exp\-sgcheck, exp\-bbv, exp\-dhat, etc\&.
53.RE
54.SH "BASIC OPTIONS"
55.PP
56These options work with all tools\&.
57.PP
58\fB\-h \-\-help\fR
59.RS 4
60Show help for all options, both for the core and for the selected tool\&. If the option is repeated it is equivalent to giving
61\fB\-\-help\-debug\fR\&.
62.RE
63.PP
64\fB\-\-help\-debug\fR
65.RS 4
66Same as
67\fB\-\-help\fR, but also lists debugging options which usually are only of use to Valgrind\*(Aqs developers\&.
68.RE
69.PP
70\fB\-\-version\fR
71.RS 4
72Show the version number of the Valgrind core\&. Tools can have their own version numbers\&. There is a scheme in place to ensure that tools only execute when the core version is one they are known to work with\&. This was done to minimise the chances of strange problems arising from tool\-vs\-core version incompatibilities\&.
73.RE
74.PP
75\fB\-q\fR, \fB\-\-quiet\fR
76.RS 4
77Run silently, and only print error messages\&. Useful if you are running regression tests or have some other automated test machinery\&.
78.RE
79.PP
80\fB\-v\fR, \fB\-\-verbose\fR
81.RS 4
82Be more verbose\&. Gives extra information on various aspects of your program, such as: the shared objects loaded, the suppressions used, the progress of the instrumentation and execution engines, and warnings about unusual behaviour\&. Repeating the option increases the verbosity level\&.
83.RE
84.PP
85\fB\-\-trace\-children=<yes|no> [default: no] \fR
86.RS 4
87When enabled, Valgrind will trace into sub\-processes initiated via the
88\fIexec\fR
89system call\&. This is necessary for multi\-process programs\&.
90.sp
91Note that Valgrind does trace into the child of a
92\fIfork\fR
93(it would be difficult not to, since
94\fIfork\fR
95makes an identical copy of a process), so this option is arguably badly named\&. However, most children of
96\fIfork\fR
97calls immediately call
98\fIexec\fR
99anyway\&.
100.RE
101.PP
102\fB\-\-trace\-children\-skip=patt1,patt2,\&.\&.\&. \fR
103.RS 4
104This option only has an effect when
105\fB\-\-trace\-children=yes\fR
106is specified\&. It allows for some children to be skipped\&. The option takes a comma separated list of patterns for the names of child executables that Valgrind should not trace into\&. Patterns may include the metacharacters
107?
108and
109*, which have the usual meaning\&.
110.sp
111This can be useful for pruning uninteresting branches from a tree of processes being run on Valgrind\&. But you should be careful when using it\&. When Valgrind skips tracing into an executable, it doesn\*(Aqt just skip tracing that executable, it also skips tracing any of that executable\*(Aqs child processes\&. In other words, the flag doesn\*(Aqt merely cause tracing to stop at the specified executables \-\- it skips tracing of entire process subtrees rooted at any of the specified executables\&.
112.RE
113.PP
114\fB\-\-trace\-children\-skip\-by\-arg=patt1,patt2,\&.\&.\&. \fR
115.RS 4
116This is the same as
117\fB\-\-trace\-children\-skip\fR, with one difference: the decision as to whether to trace into a child process is made by examining the arguments to the child process, rather than the name of its executable\&.
118.RE
119.PP
120\fB\-\-child\-silent\-after\-fork=<yes|no> [default: no] \fR
121.RS 4
122When enabled, Valgrind will not show any debugging or logging output for the child process resulting from a
123\fIfork\fR
124call\&. This can make the output less confusing (although more misleading) when dealing with processes that create children\&. It is particularly useful in conjunction with
125\fI\-\-trace\-children=\fR\&. Use of this option is also strongly recommended if you are requesting XML output (\fI\-\-xml=yes\fR), since otherwise the XML from child and parent may become mixed up, which usually makes it useless\&.
126.RE
127.PP
128\fB\-\-vgdb=<no|yes|full> [default: yes] \fR
129.RS 4
130Valgrind will provide "gdbserver" functionality when
131\fB\-\-vgdb=yes\fR
132or
133\fB\-\-vgdb=full\fR
134is specified\&. This allows an external GNU GDB debugger to control and debug your program when it runs on Valgrind\&.
135\fB\-\-vgdb=full\fR
136incurs significant performance overheads, but provides more precise breakpoints and watchpoints\&. See
137Debugging your program using Valgrind's gdbserver and GDB
138for a detailed description\&.
139.sp
140If the embedded gdbserver is enabled but no gdb is currently being used, the
141vgdb
142command line utility can send "monitor commands" to Valgrind from a shell\&. The Valgrind core provides a set of
143Valgrind monitor commands\&. A tool can optionally provide tool specific monitor commands, which are documented in the tool specific chapter\&.
144.RE
145.PP
146\fB\-\-vgdb\-error=<number> [default: 999999999] \fR
147.RS 4
148Use this option when the Valgrind gdbserver is enabled with
149\fB\-\-vgdb=yes\fR
150or
151\fB\-\-vgdb=full\fR\&. Tools that report errors will wait for "number" errors to be reported before freezing the program and waiting for you to connect with GDB\&. It follows that a value of zero will cause the gdbserver to be started before your program is executed\&. This is typically used to insert GDB breakpoints before execution, and also works with tools that do not report errors, such as Massif\&.
152.RE
153.PP
154\fB\-\-vgdb\-stop\-at=<set> [default: none] \fR
155.RS 4
156Use this option when the Valgrind gdbserver is enabled with
157\fB\-\-vgdb=yes\fR
158or
159\fB\-\-vgdb=full\fR\&. The Valgrind gdbserver will be invoked for each error after
160\fB\-\-vgdb\-error\fR
161have been reported\&. You can additionally ask the Valgrind gdbserver to be invoked for other events, specified in one of the following ways:
162.sp
163.RS 4
164.ie n \{\
165\h'-04'\(bu\h'+03'\c
166.\}
167.el \{\
168.sp -1
169.IP \(bu 2.3
170.\}
171a comma separated list of one or more of
172\fBstartup exit valgrindabexit\fR\&.
173.sp
174The values
175\fBstartup\fR\fBexit\fR\fBvalgrindabexit\fR
176respectively indicate to invoke gdbserver before your program is executed, after the last instruction of your program, on Valgrind abnormal exit (e\&.g\&. internal error, out of memory, \&.\&.\&.)\&.
177.sp
178Note:
179\fBstartup\fR
180and
181\fB\-\-vgdb\-error=0\fR
182will both cause Valgrind gdbserver to be invoked before your program is executed\&. The
183\fB\-\-vgdb\-error=0\fR
184will in addition cause your program to stop on all subsequent errors\&.
185.RE
186.sp
187.RS 4
188.ie n \{\
189\h'-04'\(bu\h'+03'\c
190.\}
191.el \{\
192.sp -1
193.IP \(bu 2.3
194.\}
195\fBall\fR
196to specify the complete set\&. It is equivalent to
197\fB\-\-vgdb\-stop\-at=startup,exit,valgrindabexit\fR\&.
198.RE
199.sp
200.RS 4
201.ie n \{\
202\h'-04'\(bu\h'+03'\c
203.\}
204.el \{\
205.sp -1
206.IP \(bu 2.3
207.\}
208\fBnone\fR
209for the empty set\&.
210.RE
211.RE
212.PP
213\fB\-\-track\-fds=<yes|no> [default: no] \fR
214.RS 4
215When enabled, Valgrind will print out a list of open file descriptors on exit or on request, via the gdbserver monitor command
216\fIv\&.info open_fds\fR\&. Along with each file descriptor is printed a stack backtrace of where the file was opened and any details relating to the file descriptor such as the file name or socket details\&.
217.RE
218.PP
219\fB\-\-time\-stamp=<yes|no> [default: no] \fR
220.RS 4
221When enabled, each message is preceded with an indication of the elapsed wallclock time since startup, expressed as days, hours, minutes, seconds and milliseconds\&.
222.RE
223.PP
224\fB\-\-log\-fd=<number> [default: 2, stderr] \fR
225.RS 4
226Specifies that Valgrind should send all of its messages to the specified file descriptor\&. The default, 2, is the standard error channel (stderr)\&. Note that this may interfere with the client\*(Aqs own use of stderr, as Valgrind\*(Aqs output will be interleaved with any output that the client sends to stderr\&.
227.RE
228.PP
229\fB\-\-log\-file=<filename> \fR
230.RS 4
231Specifies that Valgrind should send all of its messages to the specified file\&. If the file name is empty, it causes an abort\&. There are three special format specifiers that can be used in the file name\&.
232.sp
233\fB%p\fR
234is replaced with the current process ID\&. This is very useful for program that invoke multiple processes\&. WARNING: If you use
235\fB\-\-trace\-children=yes\fR
236and your program invokes multiple processes OR your program forks without calling exec afterwards, and you don\*(Aqt use this specifier (or the
237\fB%q\fR
238specifier below), the Valgrind output from all those processes will go into one file, possibly jumbled up, and possibly incomplete\&.
239.sp
240\fB%q{FOO}\fR
241is replaced with the contents of the environment variable
242\fIFOO\fR\&. If the
243\fB{FOO}\fR
244part is malformed, it causes an abort\&. This specifier is rarely needed, but very useful in certain circumstances (eg\&. when running MPI programs)\&. The idea is that you specify a variable which will be set differently for each process in the job, for example
245BPROC_RANK
246or whatever is applicable in your MPI setup\&. If the named environment variable is not set, it causes an abort\&. Note that in some shells, the
247\fB{\fR
248and
249\fB}\fR
250characters may need to be escaped with a backslash\&.
251.sp
252\fB%%\fR
253is replaced with
254\fB%\fR\&.
255.sp
256If an
257\fB%\fR
258is followed by any other character, it causes an abort\&.
259.sp
260If the file name specifies a relative file name, it is put in the program\*(Aqs initial working directory : this is the current directory when the program started its execution after the fork or after the exec\&. If it specifies an absolute file name (ie\&. starts with \*(Aq/\*(Aq) then it is put there\&.
261.RE
262.PP
263\fB\-\-log\-socket=<ip\-address:port\-number> \fR
264.RS 4
265Specifies that Valgrind should send all of its messages to the specified port at the specified IP address\&. The port may be omitted, in which case port 1500 is used\&. If a connection cannot be made to the specified socket, Valgrind falls back to writing output to the standard error (stderr)\&. This option is intended to be used in conjunction with the
266valgrind\-listener
267program\&. For further details, see
268the commentary
269in the manual\&.
270.RE
271.SH "ERROR-RELATED OPTIONS"
272.PP
273These options are used by all tools that can report errors, e\&.g\&. Memcheck, but not Cachegrind\&.
274.PP
275\fB\-\-xml=<yes|no> [default: no] \fR
276.RS 4
277When enabled, the important parts of the output (e\&.g\&. tool error messages) will be in XML format rather than plain text\&. Furthermore, the XML output will be sent to a different output channel than the plain text output\&. Therefore, you also must use one of
278\fB\-\-xml\-fd\fR,
279\fB\-\-xml\-file\fR
280or
281\fB\-\-xml\-socket\fR
282to specify where the XML is to be sent\&.
283.sp
284Less important messages will still be printed in plain text, but because the XML output and plain text output are sent to different output channels (the destination of the plain text output is still controlled by
285\fB\-\-log\-fd\fR,
286\fB\-\-log\-file\fR
287and
288\fB\-\-log\-socket\fR) this should not cause problems\&.
289.sp
290This option is aimed at making life easier for tools that consume Valgrind\*(Aqs output as input, such as GUI front ends\&. Currently this option works with Memcheck, Helgrind, DRD and SGcheck\&. The output format is specified in the file
291docs/internals/xml\-output\-protocol4\&.txt
292in the source tree for Valgrind 3\&.5\&.0 or later\&.
293.sp
294The recommended options for a GUI to pass, when requesting XML output, are:
295\fB\-\-xml=yes\fR
296to enable XML output,
297\fB\-\-xml\-file\fR
298to send the XML output to a (presumably GUI\-selected) file,
299\fB\-\-log\-file\fR
300to send the plain text output to a second GUI\-selected file,
301\fB\-\-child\-silent\-after\-fork=yes\fR, and
302\fB\-q\fR
303to restrict the plain text output to critical error messages created by Valgrind itself\&. For example, failure to read a specified suppressions file counts as a critical error message\&. In this way, for a successful run the text output file will be empty\&. But if it isn\*(Aqt empty, then it will contain important information which the GUI user should be made aware of\&.
304.RE
305.PP
306\fB\-\-xml\-fd=<number> [default: \-1, disabled] \fR
307.RS 4
308Specifies that Valgrind should send its XML output to the specified file descriptor\&. It must be used in conjunction with
309\fB\-\-xml=yes\fR\&.
310.RE
311.PP
312\fB\-\-xml\-file=<filename> \fR
313.RS 4
314Specifies that Valgrind should send its XML output to the specified file\&. It must be used in conjunction with
315\fB\-\-xml=yes\fR\&. Any
316\fB%p\fR
317or
318\fB%q\fR
319sequences appearing in the filename are expanded in exactly the same way as they are for
320\fB\-\-log\-file\fR\&. See the description of
321\fB\-\-log\-file\fR
322for details\&.
323.RE
324.PP
325\fB\-\-xml\-socket=<ip\-address:port\-number> \fR
326.RS 4
327Specifies that Valgrind should send its XML output the specified port at the specified IP address\&. It must be used in conjunction with
328\fB\-\-xml=yes\fR\&. The form of the argument is the same as that used by
329\fB\-\-log\-socket\fR\&. See the description of
330\fB\-\-log\-socket\fR
331for further details\&.
332.RE
333.PP
334\fB\-\-xml\-user\-comment=<string> \fR
335.RS 4
336Embeds an extra user comment string at the start of the XML output\&. Only works when
337\fB\-\-xml=yes\fR
338is specified; ignored otherwise\&.
339.RE
340.PP
341\fB\-\-demangle=<yes|no> [default: yes] \fR
342.RS 4
343Enable/disable automatic demangling (decoding) of C++ names\&. Enabled by default\&. When enabled, Valgrind will attempt to translate encoded C++ names back to something approaching the original\&. The demangler handles symbols mangled by g++ versions 2\&.X, 3\&.X and 4\&.X\&.
344.sp
345An important fact about demangling is that function names mentioned in suppressions files should be in their mangled form\&. Valgrind does not demangle function names when searching for applicable suppressions, because to do otherwise would make suppression file contents dependent on the state of Valgrind\*(Aqs demangling machinery, and also slow down suppression matching\&.
346.RE
347.PP
348\fB\-\-num\-callers=<number> [default: 12] \fR
349.RS 4
350Specifies the maximum number of entries shown in stack traces that identify program locations\&. Note that errors are commoned up using only the top four function locations (the place in the current function, and that of its three immediate callers)\&. So this doesn\*(Aqt affect the total number of errors reported\&.
351.sp
352The maximum value for this is 500\&. Note that higher settings will make Valgrind run a bit more slowly and take a bit more memory, but can be useful when working with programs with deeply\-nested call chains\&.
353.RE
354.PP
355\fB\-\-unw\-stack\-scan\-thresh=<number> [default: 0] \fR, \fB\-\-unw\-stack\-scan\-frames=<number> [default: 5] \fR
356.RS 4
357Stack\-scanning support is available only on ARM targets\&.
358.sp
359These flags enable and control stack unwinding by stack scanning\&. When the normal stack unwinding mechanisms \-\- usage of Dwarf CFI records, and frame\-pointer following \-\- fail, stack scanning may be able to recover a stack trace\&.
360.sp
361Note that stack scanning is an imprecise, heuristic mechanism that may give very misleading results, or none at all\&. It should be used only in emergencies, when normal unwinding fails, and it is important to nevertheless have stack traces\&.
362.sp
363Stack scanning is a simple technique: the unwinder reads words from the stack, and tries to guess which of them might be return addresses, by checking to see if they point just after ARM or Thumb call instructions\&. If so, the word is added to the backtrace\&.
364.sp
365The main danger occurs when a function call returns, leaving its return address exposed, and a new function is called, but the new function does not overwrite the old address\&. The result of this is that the backtrace may contain entries for functions which have already returned, and so be very confusing\&.
366.sp
367A second limitation of this implementation is that it will scan only the page (4KB, normally) containing the starting stack pointer\&. If the stack frames are large, this may result in only a few (or not even any) being present in the trace\&. Also, if you are unlucky and have an initial stack pointer near the end of its containing page, the scan may miss all interesting frames\&.
368.sp
369By default stack scanning is disabled\&. The normal use case is to ask for it when a stack trace would otherwise be very short\&. So, to enable it, use
370\-\-unw\-stack\-scan\-thresh=number\&. This requests Valgrind to try using stack scanning to "extend" stack traces which contain fewer than
371number
372frames\&.
373.sp
374If stack scanning does take place, it will only generate at most the number of frames specified by
375\-\-unw\-stack\-scan\-frames\&. Typically, stack scanning generates so many garbage entries that this value is set to a low value (5) by default\&. In no case will a stack trace larger than the value specified by
376\-\-num\-callers
377be created\&.
378.RE
379.PP
380\fB\-\-error\-limit=<yes|no> [default: yes] \fR
381.RS 4
382When enabled, Valgrind stops reporting errors after 10,000,000 in total, or 1,000 different ones, have been seen\&. This is to stop the error tracking machinery from becoming a huge performance overhead in programs with many errors\&.
383.RE
384.PP
385\fB\-\-error\-exitcode=<number> [default: 0] \fR
386.RS 4
387Specifies an alternative exit code to return if Valgrind reported any errors in the run\&. When set to the default value (zero), the return value from Valgrind will always be the return value of the process being simulated\&. When set to a nonzero value, that value is returned instead, if Valgrind detects any errors\&. This is useful for using Valgrind as part of an automated test suite, since it makes it easy to detect test cases for which Valgrind has reported errors, just by inspecting return codes\&.
388.RE
389.PP
390\fB\-\-error\-markers=<begin>,<end> [default: none]\fR
391.RS 4
392When errors are output as plain text (i\&.e\&. XML not used),
393\fB\-\-error\-markers\fR
394instructs to output a line containing the
395\fBbegin\fR
396(\fBend\fR) string before (after) each error\&.
397.sp
398Such marker lines facilitate searching for errors and/or extracting errors in an output file that contain valgrind errors mixed with the program output\&.
399.sp
400Note that empty markers are accepted\&. So, only using a begin (or an end) marker is possible\&.
401.RE
402.PP
403\fB\-\-sigill\-diagnostics=<yes|no> [default: yes] \fR
404.RS 4
405Enable/disable printing of illegal instruction diagnostics\&. Enabled by default, but defaults to disabled when
406\fB\-\-quiet\fR
407is given\&. The default can always be explicitly overridden by giving this option\&.
408.sp
409When enabled, a warning message will be printed, along with some diagnostics, whenever an instruction is encountered that Valgrind cannot decode or translate, before the program is given a SIGILL signal\&. Often an illegal instruction indicates a bug in the program or missing support for the particular instruction in Valgrind\&. But some programs do deliberately try to execute an instruction that might be missing and trap the SIGILL signal to detect processor features\&. Using this flag makes it possible to avoid the diagnostic output that you would otherwise get in such cases\&.
410.RE
411.PP
412\fB\-\-show\-below\-main=<yes|no> [default: no] \fR
413.RS 4
414By default, stack traces for errors do not show any functions that appear beneath
415\fBmain\fR
416because most of the time it\*(Aqs uninteresting C library stuff and/or gobbledygook\&. Alternatively, if
417\fBmain\fR
418is not present in the stack trace, stack traces will not show any functions below
419\fBmain\fR\-like functions such as glibc\*(Aqs
420\fB__libc_start_main\fR\&. Furthermore, if
421\fBmain\fR\-like functions are present in the trace, they are normalised as
422\fB(below main)\fR, in order to make the output more deterministic\&.
423.sp
424If this option is enabled, all stack trace entries will be shown and
425\fBmain\fR\-like functions will not be normalised\&.
426.RE
427.PP
428\fB\-\-fullpath\-after=<string> [default: don\*(Aqt show source paths] \fR
429.RS 4
430By default Valgrind only shows the filenames in stack traces, but not full paths to source files\&. When using Valgrind in large projects where the sources reside in multiple different directories, this can be inconvenient\&.
431\fB\-\-fullpath\-after\fR
432provides a flexible solution to this problem\&. When this option is present, the path to each source file is shown, with the following all\-important caveat: if
433\fBstring\fR
434is found in the path, then the path up to and including
435\fBstring\fR
436is omitted, else the path is shown unmodified\&. Note that
437\fBstring\fR
438is not required to be a prefix of the path\&.
439.sp
440For example, consider a file named
441/home/janedoe/blah/src/foo/bar/xyzzy\&.c\&. Specifying
442\fB\-\-fullpath\-after=/home/janedoe/blah/src/\fR
443will cause Valgrind to show the name as
444foo/bar/xyzzy\&.c\&.
445.sp
446Because the string is not required to be a prefix,
447\fB\-\-fullpath\-after=src/\fR
448will produce the same output\&. This is useful when the path contains arbitrary machine\-generated characters\&. For example, the path
449/my/build/dir/C32A1B47/blah/src/foo/xyzzy
450can be pruned to
451foo/xyzzy
452using
453\fB\-\-fullpath\-after=/blah/src/\fR\&.
454.sp
455If you simply want to see the full path, just specify an empty string:
456\fB\-\-fullpath\-after=\fR\&. This isn\*(Aqt a special case, merely a logical consequence of the above rules\&.
457.sp
458Finally, you can use
459\fB\-\-fullpath\-after\fR
460multiple times\&. Any appearance of it causes Valgrind to switch to producing full paths and applying the above filtering rule\&. Each produced path is compared against all the
461\fB\-\-fullpath\-after\fR\-specified strings, in the order specified\&. The first string to match causes the path to be truncated as described above\&. If none match, the full path is shown\&. This facilitates chopping off prefixes when the sources are drawn from a number of unrelated directories\&.
462.RE
463.PP
464\fB\-\-extra\-debuginfo\-path=<path> [default: undefined and unused] \fR
465.RS 4
466By default Valgrind searches in several well\-known paths for debug objects, such as
467/usr/lib/debug/\&.
468.sp
469However, there may be scenarios where you may wish to put debug objects at an arbitrary location, such as external storage when running Valgrind on a mobile device with limited local storage\&. Another example might be a situation where you do not have permission to install debug object packages on the system where you are running Valgrind\&.
470.sp
471In these scenarios, you may provide an absolute path as an extra, final place for Valgrind to search for debug objects by specifying
472\fB\-\-extra\-debuginfo\-path=/path/to/debug/objects\fR\&. The given path will be prepended to the absolute path name of the searched\-for object\&. For example, if Valgrind is looking for the debuginfo for
473/w/x/y/zz\&.so
474and
475\fB\-\-extra\-debuginfo\-path=/a/b/c\fR
476is specified, it will look for a debug object at
477/a/b/c/w/x/y/zz\&.so\&.
478.sp
479This flag should only be specified once\&. If it is specified multiple times, only the last instance is honoured\&.
480.RE
481.PP
482\fB\-\-debuginfo\-server=ipaddr:port [default: undefined and unused]\fR
483.RS 4
484This is a new, experimental, feature introduced in version 3\&.9\&.0\&.
485.sp
486In some scenarios it may be convenient to read debuginfo from objects stored on a different machine\&. With this flag, Valgrind will query a debuginfo server running on
487ipaddr
488and listening on port
489port, if it cannot find the debuginfo object in the local filesystem\&.
490.sp
491The debuginfo server must accept TCP connections on port
492port\&. The debuginfo server is contained in the source file
493auxprogs/valgrind\-di\-server\&.c\&. It will only serve from the directory it is started in\&.
494port
495defaults to 1500 in both client and server if not specified\&.
496.sp
497If Valgrind looks for the debuginfo for
498/w/x/y/zz\&.so
499by using the debuginfo server, it will strip the pathname components and merely request
500zz\&.so
501on the server\&. That in turn will look only in its current working directory for a matching debuginfo object\&.
502.sp
503The debuginfo data is transmitted in small fragments (8 KB) as requested by Valgrind\&. Each block is compressed using LZO to reduce transmission time\&. The implementation has been tuned for best performance over a single\-stage 802\&.11g (WiFi) network link\&.
504.sp
505Note that checks for matching primary vs debug objects, using GNU debuglink CRC scheme, are performed even when using the debuginfo server\&. To disable such checking, you need to also specify
506\-\-allow\-mismatched\-debuginfo=yes\&.
507.sp
508By default the Valgrind build system will build
509valgrind\-di\-server
510for the target platform, which is almost certainly not what you want\&. So far we have been unable to find out how to get automake/autoconf to build it for the build platform\&. If you want to use it, you will have to recompile it by hand using the command shown at the top of
511auxprogs/valgrind\-di\-server\&.c\&.
512.RE
513.PP
514\fB\-\-allow\-mismatched\-debuginfo=no|yes [no] \fR
515.RS 4
516When reading debuginfo from separate debuginfo objects, Valgrind will by default check that the main and debuginfo objects match, using the GNU debuglink mechanism\&. This guarantees that it does not read debuginfo from out of date debuginfo objects, and also ensures that Valgrind can\*(Aqt crash as a result of mismatches\&.
517.sp
518This check can be overridden using
519\-\-allow\-mismatched\-debuginfo=yes\&. This may be useful when the debuginfo and main objects have not been split in the proper way\&. Be careful when using this, though: it disables all consistency checking, and Valgrind has been observed to crash when the main and debuginfo objects don\*(Aqt match\&.
520.RE
521.PP
522\fB\-\-suppressions=<filename> [default: $PREFIX/lib/valgrind/default\&.supp] \fR
523.RS 4
524Specifies an extra file from which to read descriptions of errors to suppress\&. You may use up to 100 extra suppression files\&.
525.RE
526.PP
527\fB\-\-gen\-suppressions=<yes|no|all> [default: no] \fR
528.RS 4
529When set to
530\fIyes\fR, Valgrind will pause after every error shown and print the line:
531.sp
532.if n \{\
533.RS 4
534.\}
535.nf
536 \-\-\-\- Print suppression ? \-\-\- [Return/N/n/Y/y/C/c] \-\-\-\-
537.fi
538.if n \{\
539.RE
540.\}
541.sp
542Pressing
543\fIRet\fR, or
544\fIN Ret\fR
545or
546\fIn Ret\fR, causes Valgrind continue execution without printing a suppression for this error\&.
547.sp
548Pressing
549\fIY Ret\fR
550or
551\fIy Ret\fR
552causes Valgrind to write a suppression for this error\&. You can then cut and paste it into a suppression file if you don\*(Aqt want to hear about the error in the future\&.
553.sp
554When set to
555\fIall\fR, Valgrind will print a suppression for every reported error, without querying the user\&.
556.sp
557This option is particularly useful with C++ programs, as it prints out the suppressions with mangled names, as required\&.
558.sp
559Note that the suppressions printed are as specific as possible\&. You may want to common up similar ones, by adding wildcards to function names, and by using frame\-level wildcards\&. The wildcarding facilities are powerful yet flexible, and with a bit of careful editing, you may be able to suppress a whole family of related errors with only a few suppressions\&.
560.sp
561Sometimes two different errors are suppressed by the same suppression, in which case Valgrind will output the suppression more than once, but you only need to have one copy in your suppression file (but having more than one won\*(Aqt cause problems)\&. Also, the suppression name is given as
562<insert a suppression name here>; the name doesn\*(Aqt really matter, it\*(Aqs only used with the
563\fB\-v\fR
564option which prints out all used suppression records\&.
565.RE
566.PP
567\fB\-\-input\-fd=<number> [default: 0, stdin] \fR
568.RS 4
569When using
570\fB\-\-gen\-suppressions=yes\fR, Valgrind will stop so as to read keyboard input from you when each error occurs\&. By default it reads from the standard input (stdin), which is problematic for programs which close stdin\&. This option allows you to specify an alternative file descriptor from which to read input\&.
571.RE
572.PP
573\fB\-\-dsymutil=no|yes [yes] \fR
574.RS 4
575This option is only relevant when running Valgrind on Mac OS X\&.
576.sp
577Mac OS X uses a deferred debug information (debuginfo) linking scheme\&. When object files containing debuginfo are linked into a
578\&.dylib
579or an executable, the debuginfo is not copied into the final file\&. Instead, the debuginfo must be linked manually by running
580dsymutil, a system\-provided utility, on the executable or
581\&.dylib\&. The resulting combined debuginfo is placed in a directory alongside the executable or
582\&.dylib, but with the extension
583\&.dSYM\&.
584.sp
585With
586\fB\-\-dsymutil=no\fR, Valgrind will detect cases where the
587\&.dSYM
588directory is either missing, or is present but does not appear to match the associated executable or
589\&.dylib, most likely because it is out of date\&. In these cases, Valgrind will print a warning message but take no further action\&.
590.sp
591With
592\fB\-\-dsymutil=yes\fR, Valgrind will, in such cases, automatically run
593dsymutil
594as necessary to bring the debuginfo up to date\&. For all practical purposes, if you always use
595\fB\-\-dsymutil=yes\fR, then there is never any need to run
596dsymutil
597manually or as part of your applications\*(Aqs build system, since Valgrind will run it as necessary\&.
598.sp
599Valgrind will not attempt to run
600dsymutil
601on any executable or library in
602/usr/,
603/bin/,
604/sbin/,
605/opt/,
606/sw/,
607/System/,
608/Library/
609or
610/Applications/
611since
612dsymutil
613will always fail in such situations\&. It fails both because the debuginfo for such pre\-installed system components is not available anywhere, and also because it would require write privileges in those directories\&.
614.sp
615Be careful when using
616\fB\-\-dsymutil=yes\fR, since it will cause pre\-existing
617\&.dSYM
618directories to be silently deleted and re\-created\&. Also note that
619dsymutil
620is quite slow, sometimes excessively so\&.
621.RE
622.PP
623\fB\-\-max\-stackframe=<number> [default: 2000000] \fR
624.RS 4
625The maximum size of a stack frame\&. If the stack pointer moves by more than this amount then Valgrind will assume that the program is switching to a different stack\&.
626.sp
627You may need to use this option if your program has large stack\-allocated arrays\&. Valgrind keeps track of your program\*(Aqs stack pointer\&. If it changes by more than the threshold amount, Valgrind assumes your program is switching to a different stack, and Memcheck behaves differently than it would for a stack pointer change smaller than the threshold\&. Usually this heuristic works well\&. However, if your program allocates large structures on the stack, this heuristic will be fooled, and Memcheck will subsequently report large numbers of invalid stack accesses\&. This option allows you to change the threshold to a different value\&.
628.sp
629You should only consider use of this option if Valgrind\*(Aqs debug output directs you to do so\&. In that case it will tell you the new threshold you should specify\&.
630.sp
631In general, allocating large structures on the stack is a bad idea, because you can easily run out of stack space, especially on systems with limited memory or which expect to support large numbers of threads each with a small stack, and also because the error checking performed by Memcheck is more effective for heap\-allocated data than for stack\-allocated data\&. If you have to use this option, you may wish to consider rewriting your code to allocate on the heap rather than on the stack\&.
632.RE
633.PP
634\fB\-\-main\-stacksize=<number> [default: use current \*(Aqulimit\*(Aq value] \fR
635.RS 4
636Specifies the size of the main thread\*(Aqs stack\&.
637.sp
638To simplify its memory management, Valgrind reserves all required space for the main thread\*(Aqs stack at startup\&. That means it needs to know the required stack size at startup\&.
639.sp
640By default, Valgrind uses the current "ulimit" value for the stack size, or 16 MB, whichever is lower\&. In many cases this gives a stack size in the range 8 to 16 MB, which almost never overflows for most applications\&.
641.sp
642If you need a larger total stack size, use
643\fB\-\-main\-stacksize\fR
644to specify it\&. Only set it as high as you need, since reserving far more space than you need (that is, hundreds of megabytes more than you need) constrains Valgrind\*(Aqs memory allocators and may reduce the total amount of memory that Valgrind can use\&. This is only really of significance on 32\-bit machines\&.
645.sp
646On Linux, you may request a stack of size up to 2GB\&. Valgrind will stop with a diagnostic message if the stack cannot be allocated\&.
647.sp
648\fB\-\-main\-stacksize\fR
649only affects the stack size for the program\*(Aqs initial thread\&. It has no bearing on the size of thread stacks, as Valgrind does not allocate those\&.
650.sp
651You may need to use both
652\fB\-\-main\-stacksize\fR
653and
654\fB\-\-max\-stackframe\fR
655together\&. It is important to understand that
656\fB\-\-main\-stacksize\fR
657sets the maximum total stack size, whilst
658\fB\-\-max\-stackframe\fR
659specifies the largest size of any one stack frame\&. You will have to work out the
660\fB\-\-main\-stacksize\fR
661value for yourself (usually, if your applications segfaults)\&. But Valgrind will tell you the needed
662\fB\-\-max\-stackframe\fR
663size, if necessary\&.
664.sp
665As discussed further in the description of
666\fB\-\-max\-stackframe\fR, a requirement for a large stack is a sign of potential portability problems\&. You are best advised to place all large data in heap\-allocated memory\&.
667.RE
668.PP
669\fB\-\-max\-threads=<number> [default: 500] \fR
670.RS 4
671By default, Valgrind can handle to up to 500 threads\&. Occasionally, that number is too small\&. Use this option to provide a different limit\&. E\&.g\&.
672\-\-max\-threads=3000\&.
673.RE
674.SH "MALLOC()-RELATED OPTIONS"
675.PP
676For tools that use their own version of
677malloc
678(e\&.g\&. Memcheck, Massif, Helgrind, DRD), the following options apply\&.
679.PP
680\fB\-\-alignment=<number> [default: 8 or 16, depending on the platform] \fR
681.RS 4
682By default Valgrind\*(Aqs
683\fBmalloc\fR,
684\fBrealloc\fR, etc, return a block whose starting address is 8\-byte aligned or 16\-byte aligned (the value depends on the platform and matches the platform default)\&. This option allows you to specify a different alignment\&. The supplied value must be greater than or equal to the default, less than or equal to 4096, and must be a power of two\&.
685.RE
686.PP
687\fB\-\-redzone\-size=<number> [default: depends on the tool] \fR
688.RS 4
689Valgrind\*(Aqs
690\fBmalloc, realloc,\fR
691etc, add padding blocks before and after each heap block allocated by the program being run\&. Such padding blocks are called redzones\&. The default value for the redzone size depends on the tool\&. For example, Memcheck adds and protects a minimum of 16 bytes before and after each block allocated by the client\&. This allows it to detect block underruns or overruns of up to 16 bytes\&.
692.sp
693Increasing the redzone size makes it possible to detect overruns of larger distances, but increases the amount of memory used by Valgrind\&. Decreasing the redzone size will reduce the memory needed by Valgrind but also reduces the chances of detecting over/underruns, so is not recommended\&.
694.RE
695.SH "UNCOMMON OPTIONS"
696.PP
697These options apply to all tools, as they affect certain obscure workings of the Valgrind core\&. Most people won\*(Aqt need to use them\&.
698.PP
699\fB\-\-smc\-check=<none|stack|all|all\-non\-file> [default: all\-non\-file for x86/amd64/s390x, stack for other archs] \fR
700.RS 4
701This option controls Valgrind\*(Aqs detection of self\-modifying code\&. If no checking is done, when a program executes some code, then overwrites it with new code, and executes the new code, Valgrind will continue to execute the translations it made for the old code\&. This will likely lead to incorrect behaviour and/or crashes\&.
702.sp
703For "modern" architectures \-\- anything that\*(Aqs not x86, amd64 or s390x \-\- the default is
704\fIstack\fR\&. This is because a correct program must take explicit action to reestablish D\-I cache coherence following code modification\&. Valgrind observes and honours such actions, with the result that self\-modifying code is transparently handled with zero extra cost\&.
705.sp
706For x86, amd64 and s390x, the program is not required to notify the hardware of required D\-I coherence syncing\&. Hence the default is
707\fIall\-non\-file\fR, which covers the normal case of generating code into an anonymous (non\-file\-backed) mmap\*(Aqd area\&.
708.sp
709The meanings of the four available settings are as follows\&. No detection (\fInone\fR), detect self\-modifying code on the stack (which is used by GCC to implement nested functions) (\fIstack\fR), detect self\-modifying code everywhere (\fIall\fR), and detect self\-modifying code everywhere except in file\-backed mappings (\fIall\-non\-file\fR)\&.
710.sp
711Running with
712\fIall\fR
713will slow Valgrind down noticeably\&. Running with
714\fInone\fR
715will rarely speed things up, since very little code gets dynamically generated in most programs\&. The
716\fBVALGRIND_DISCARD_TRANSLATIONS\fR
717client request is an alternative to
718\fB\-\-smc\-check=all\fR
719and
720\fB\-\-smc\-check=all\-non\-file\fR
721that requires more programmer effort but allows Valgrind to run your program faster, by telling it precisely when translations need to be re\-made\&.
722.sp
723\fB\-\-smc\-check=all\-non\-file\fR
724provides a cheaper but more limited version of
725\fB\-\-smc\-check=all\fR\&. It adds checks to any translations that do not originate from file\-backed memory mappings\&. Typical applications that generate code, for example JITs in web browsers, generate code into anonymous mmaped areas, whereas the "fixed" code of the browser always lives in file\-backed mappings\&.
726\fB\-\-smc\-check=all\-non\-file\fR
727takes advantage of this observation, limiting the overhead of checking to code which is likely to be JIT generated\&.
728.RE
729.PP
730\fB\-\-read\-inline\-info=<yes|no> [default: see below] \fR
731.RS 4
732When enabled, Valgrind will read information about inlined function calls from DWARF3 debug info\&. This slows Valgrind startup and makes it use more memory (typically for each inlined piece of code, 6 words and space for the function name), but it results in more descriptive stacktraces\&. For the 3\&.10\&.0 release, this functionality is enabled by default only for Linux, Android and Solaris targets and only for the tools Memcheck, Helgrind and DRD\&. Here is an example of some stacktraces with
733\fB\-\-read\-inline\-info=no\fR:
734.sp
735.if n \{\
736.RS 4
737.\}
738.nf
739==15380== Conditional jump or move depends on uninitialised value(s)
740==15380== at 0x80484EA: main (inlinfo\&.c:6)
741==15380==
742==15380== Conditional jump or move depends on uninitialised value(s)
743==15380== at 0x8048550: fun_noninline (inlinfo\&.c:6)
744==15380== by 0x804850E: main (inlinfo\&.c:34)
745==15380==
746==15380== Conditional jump or move depends on uninitialised value(s)
747==15380== at 0x8048520: main (inlinfo\&.c:6)
748.fi
749.if n \{\
750.RE
751.\}
752.sp
753And here are the same errors with
754\fB\-\-read\-inline\-info=yes\fR:
755.sp
756.if n \{\
757.RS 4
758.\}
759.nf
760==15377== Conditional jump or move depends on uninitialised value(s)
761==15377== at 0x80484EA: fun_d (inlinfo\&.c:6)
762==15377== by 0x80484EA: fun_c (inlinfo\&.c:14)
763==15377== by 0x80484EA: fun_b (inlinfo\&.c:20)
764==15377== by 0x80484EA: fun_a (inlinfo\&.c:26)
765==15377== by 0x80484EA: main (inlinfo\&.c:33)
766==15377==
767==15377== Conditional jump or move depends on uninitialised value(s)
768==15377== at 0x8048550: fun_d (inlinfo\&.c:6)
769==15377== by 0x8048550: fun_noninline (inlinfo\&.c:41)
770==15377== by 0x804850E: main (inlinfo\&.c:34)
771==15377==
772==15377== Conditional jump or move depends on uninitialised value(s)
773==15377== at 0x8048520: fun_d (inlinfo\&.c:6)
774==15377== by 0x8048520: main (inlinfo\&.c:35)
775.fi
776.if n \{\
777.RE
778.\}
779.RE
780.PP
781\fB\-\-read\-var\-info=<yes|no> [default: no] \fR
782.RS 4
783When enabled, Valgrind will read information about variable types and locations from DWARF3 debug info\&. This slows Valgrind startup significantly and makes it use significantly more memory, but for the tools that can take advantage of it (Memcheck, Helgrind, DRD) it can result in more precise error messages\&. For example, here are some standard errors issued by Memcheck:
784.sp
785.if n \{\
786.RS 4
787.\}
788.nf
789==15363== Uninitialised byte(s) found during client check request
790==15363== at 0x80484A9: croak (varinfo1\&.c:28)
791==15363== by 0x8048544: main (varinfo1\&.c:55)
792==15363== Address 0x80497f7 is 7 bytes inside data symbol "global_i2"
793==15363==
794==15363== Uninitialised byte(s) found during client check request
795==15363== at 0x80484A9: croak (varinfo1\&.c:28)
796==15363== by 0x8048550: main (varinfo1\&.c:56)
797==15363== Address 0xbea0d0cc is on thread 1\*(Aqs stack
798==15363== in frame #1, created by main (varinfo1\&.c:45)
799.fi
800.if n \{\
801.RE
802.\}
803.sp
804And here are the same errors with
805\fB\-\-read\-var\-info=yes\fR:
806.sp
807.if n \{\
808.RS 4
809.\}
810.nf
811==15370== Uninitialised byte(s) found during client check request
812==15370== at 0x80484A9: croak (varinfo1\&.c:28)
813==15370== by 0x8048544: main (varinfo1\&.c:55)
814==15370== Location 0x80497f7 is 0 bytes inside global_i2[7],
815==15370== a global variable declared at varinfo1\&.c:41
816==15370==
817==15370== Uninitialised byte(s) found during client check request
818==15370== at 0x80484A9: croak (varinfo1\&.c:28)
819==15370== by 0x8048550: main (varinfo1\&.c:56)
820==15370== Location 0xbeb4a0cc is 0 bytes inside local var "local"
821==15370== declared at varinfo1\&.c:46, in frame #1 of thread 1
822.fi
823.if n \{\
824.RE
825.\}
826.RE
827.PP
828\fB\-\-vgdb\-poll=<number> [default: 5000] \fR
829.RS 4
830As part of its main loop, the Valgrind scheduler will poll to check if some activity (such as an external command or some input from a gdb) has to be handled by gdbserver\&. This activity poll will be done after having run the given number of basic blocks (or slightly more than the given number of basic blocks)\&. This poll is quite cheap so the default value is set relatively low\&. You might further decrease this value if vgdb cannot use ptrace system call to interrupt Valgrind if all threads are (most of the time) blocked in a system call\&.
831.RE
832.PP
833\fB\-\-vgdb\-shadow\-registers=no|yes [default: no] \fR
834.RS 4
835When activated, gdbserver will expose the Valgrind shadow registers to GDB\&. With this, the value of the Valgrind shadow registers can be examined or changed using GDB\&. Exposing shadow registers only works with GDB version 7\&.1 or later\&.
836.RE
837.PP
838\fB\-\-vgdb\-prefix=<prefix> [default: /tmp/vgdb\-pipe] \fR
839.RS 4
840To communicate with gdb/vgdb, the Valgrind gdbserver creates 3 files (2 named FIFOs and a mmap shared memory file)\&. The prefix option controls the directory and prefix for the creation of these files\&.
841.RE
842.PP
843\fB\-\-run\-libc\-freeres=<yes|no> [default: yes] \fR
844.RS 4
845This option is only relevant when running Valgrind on Linux\&.
846.sp
847The GNU C library (\fBlibc\&.so\fR), which is used by all programs, may allocate memory for its own uses\&. Usually it doesn\*(Aqt bother to free that memory when the program ends\(emthere would be no point, since the Linux kernel reclaims all process resources when a process exits anyway, so it would just slow things down\&.
848.sp
849The glibc authors realised that this behaviour causes leak checkers, such as Valgrind, to falsely report leaks in glibc, when a leak check is done at exit\&. In order to avoid this, they provided a routine called
850\fB__libc_freeres\fR
851specifically to make glibc release all memory it has allocated\&. Memcheck therefore tries to run
852\fB__libc_freeres\fR
853at exit\&.
854.sp
855Unfortunately, in some very old versions of glibc,
856\fB__libc_freeres\fR
857is sufficiently buggy to cause segmentation faults\&. This was particularly noticeable on Red Hat 7\&.1\&. So this option is provided in order to inhibit the run of
858\fB__libc_freeres\fR\&. If your program seems to run fine on Valgrind, but segfaults at exit, you may find that
859\fB\-\-run\-libc\-freeres=no\fR
860fixes that, although at the cost of possibly falsely reporting space leaks in
861libc\&.so\&.
862.RE
863.PP
864\fB\-\-run\-cxx\-freeres=<yes|no> [default: yes] \fR
865.RS 4
866This option is only relevant when running Valgrind on Linux or Solaris C++ programs\&.
867.sp
868The GNU Standard C++ library (\fBlibstdc++\&.so\fR), which is used by all C++ programs compiled with g++, may allocate memory for its own uses\&. Usually it doesn\*(Aqt bother to free that memory when the program ends\(emthere would be no point, since the kernel reclaims all process resources when a process exits anyway, so it would just slow things down\&.
869.sp
870The gcc authors realised that this behaviour causes leak checkers, such as Valgrind, to falsely report leaks in libstdc++, when a leak check is done at exit\&. In order to avoid this, they provided a routine called
871\fB__gnu_cxx::__freeres\fR
872specifically to make libstdc++ release all memory it has allocated\&. Memcheck therefore tries to run
873\fB__gnu_cxx::__freeres\fR
874at exit\&.
875.sp
876For the sake of flexibility and unforeseen problems with
877\fB__gnu_cxx::__freeres\fR, option
878\fB\-\-run\-cxx\-freeres=no\fR
879exists, although at the cost of possibly falsely reporting space leaks in
880libstdc++\&.so\&.
881.RE
882.PP
883\fB\-\-sim\-hints=hint1,hint2,\&.\&.\&. \fR
884.RS 4
885Pass miscellaneous hints to Valgrind which slightly modify the simulated behaviour in nonstandard or dangerous ways, possibly to help the simulation of strange features\&. By default no hints are enabled\&. Use with caution! Currently known hints are:
886.sp
887.RS 4
888.ie n \{\
889\h'-04'\(bu\h'+03'\c
890.\}
891.el \{\
892.sp -1
893.IP \(bu 2.3
894.\}
895\fBlax\-ioctls: \fR
896Be very lax about ioctl handling; the only assumption is that the size is correct\&. Doesn\*(Aqt require the full buffer to be initialised when writing\&. Without this, using some device drivers with a large number of strange ioctl commands becomes very tiresome\&.
897.RE
898.sp
899.RS 4
900.ie n \{\
901\h'-04'\(bu\h'+03'\c
902.\}
903.el \{\
904.sp -1
905.IP \(bu 2.3
906.\}
907\fBfuse\-compatible: \fR
908Enable special handling for certain system calls that may block in a FUSE file\-system\&. This may be necessary when running Valgrind on a multi\-threaded program that uses one thread to manage a FUSE file\-system and another thread to access that file\-system\&.
909.RE
910.sp
911.RS 4
912.ie n \{\
913\h'-04'\(bu\h'+03'\c
914.\}
915.el \{\
916.sp -1
917.IP \(bu 2.3
918.\}
919\fBenable\-outer: \fR
920Enable some special magic needed when the program being run is itself Valgrind\&.
921.RE
922.sp
923.RS 4
924.ie n \{\
925\h'-04'\(bu\h'+03'\c
926.\}
927.el \{\
928.sp -1
929.IP \(bu 2.3
930.\}
931\fBno\-inner\-prefix: \fR
932Disable printing a prefix
933\fB>\fR
934in front of each stdout or stderr output line in an inner Valgrind being run by an outer Valgrind\&. This is useful when running Valgrind regression tests in an outer/inner setup\&. Note that the prefix
935\fB>\fR
936will always be printed in front of the inner debug logging lines\&.
937.RE
938.sp
939.RS 4
940.ie n \{\
941\h'-04'\(bu\h'+03'\c
942.\}
943.el \{\
944.sp -1
945.IP \(bu 2.3
946.\}
947\fBno\-nptl\-pthread\-stackcache: \fR
948This hint is only relevant when running Valgrind on Linux\&.
949.sp
950The GNU glibc pthread library (\fBlibpthread\&.so\fR), which is used by pthread programs, maintains a cache of pthread stacks\&. When a pthread terminates, the memory used for the pthread stack and some thread local storage related data structure are not always directly released\&. This memory is kept in a cache (up to a certain size), and is re\-used if a new thread is started\&.
951.sp
952This cache causes the helgrind tool to report some false positive race condition errors on this cached memory, as helgrind does not understand the internal glibc cache synchronisation primitives\&. So, when using helgrind, disabling the cache helps to avoid false positive race conditions, in particular when using thread local storage variables (e\&.g\&. variables using the
953\fB__thread\fR
954qualifier)\&.
955.sp
956When using the memcheck tool, disabling the cache ensures the memory used by glibc to handle __thread variables is directly released when a thread terminates\&.
957.sp
958Note: Valgrind disables the cache using some internal knowledge of the glibc stack cache implementation and by examining the debug information of the pthread library\&. This technique is thus somewhat fragile and might not work for all glibc versions\&. This has been succesfully tested with various glibc versions (e\&.g\&. 2\&.11, 2\&.16, 2\&.18) on various platforms\&.
959.RE
960.sp
961.RS 4
962.ie n \{\
963\h'-04'\(bu\h'+03'\c
964.\}
965.el \{\
966.sp -1
967.IP \(bu 2.3
968.\}
969\fBlax\-doors: \fR
970(Solaris only) Be very lax about door syscall handling over unrecognised door file descriptors\&. Does not require that full buffer is initialised when writing\&. Without this, programs using libdoor(3LIB) functionality with completely proprietary semantics may report large number of false positives\&.
971.RE
972.RE
973.PP
974\fB\-\-fair\-sched=<no|yes|try> [default: no] \fR
975.RS 4
976The
977\fB\-\-fair\-sched\fR
978option controls the locking mechanism used by Valgrind to serialise thread execution\&. The locking mechanism controls the way the threads are scheduled, and different settings give different trade\-offs between fairness and performance\&. For more details about the Valgrind thread serialisation scheme and its impact on performance and thread scheduling, see
979Scheduling and Multi-Thread Performance\&.
980.sp
981.RS 4
982.ie n \{\
983\h'-04'\(bu\h'+03'\c
984.\}
985.el \{\
986.sp -1
987.IP \(bu 2.3
988.\}
989The value
990\fB\-\-fair\-sched=yes\fR
991activates a fair scheduler\&. In short, if multiple threads are ready to run, the threads will be scheduled in a round robin fashion\&. This mechanism is not available on all platforms or Linux versions\&. If not available, using
992\fB\-\-fair\-sched=yes\fR
993will cause Valgrind to terminate with an error\&.
994.sp
995You may find this setting improves overall responsiveness if you are running an interactive multithreaded program, for example a web browser, on Valgrind\&.
996.RE
997.sp
998.RS 4
999.ie n \{\
1000\h'-04'\(bu\h'+03'\c
1001.\}
1002.el \{\
1003.sp -1
1004.IP \(bu 2.3
1005.\}
1006The value
1007\fB\-\-fair\-sched=try\fR
1008activates fair scheduling if available on the platform\&. Otherwise, it will automatically fall back to
1009\fB\-\-fair\-sched=no\fR\&.
1010.RE
1011.sp
1012.RS 4
1013.ie n \{\
1014\h'-04'\(bu\h'+03'\c
1015.\}
1016.el \{\
1017.sp -1
1018.IP \(bu 2.3
1019.\}
1020The value
1021\fB\-\-fair\-sched=no\fR
1022activates a scheduler which does not guarantee fairness between threads ready to run, but which in general gives the highest performance\&.
1023.RE
1024.RE
1025.PP
1026\fB\-\-kernel\-variant=variant1,variant2,\&.\&.\&.\fR
1027.RS 4
1028Handle system calls and ioctls arising from minor variants of the default kernel for this platform\&. This is useful for running on hacked kernels or with kernel modules which support nonstandard ioctls, for example\&. Use with caution\&. If you don\*(Aqt understand what this option does then you almost certainly don\*(Aqt need it\&. Currently known variants are:
1029.sp
1030.RS 4
1031.ie n \{\
1032\h'-04'\(bu\h'+03'\c
1033.\}
1034.el \{\
1035.sp -1
1036.IP \(bu 2.3
1037.\}
1038\fBbproc\fR: support the
1039\fBsys_broc\fR
1040system call on x86\&. This is for running on BProc, which is a minor variant of standard Linux which is sometimes used for building clusters\&.
1041.RE
1042.sp
1043.RS 4
1044.ie n \{\
1045\h'-04'\(bu\h'+03'\c
1046.\}
1047.el \{\
1048.sp -1
1049.IP \(bu 2.3
1050.\}
1051\fBandroid\-no\-hw\-tls\fR: some versions of the Android emulator for ARM do not provide a hardware TLS (thread\-local state) register, and Valgrind crashes at startup\&. Use this variant to select software support for TLS\&.
1052.RE
1053.sp
1054.RS 4
1055.ie n \{\
1056\h'-04'\(bu\h'+03'\c
1057.\}
1058.el \{\
1059.sp -1
1060.IP \(bu 2.3
1061.\}
1062\fBandroid\-gpu\-sgx5xx\fR: use this to support handling of proprietary ioctls for the PowerVR SGX 5XX series of GPUs on Android devices\&. Failure to select this does not cause stability problems, but may cause Memcheck to report false errors after the program performs GPU\-specific ioctls\&.
1063.RE
1064.sp
1065.RS 4
1066.ie n \{\
1067\h'-04'\(bu\h'+03'\c
1068.\}
1069.el \{\
1070.sp -1
1071.IP \(bu 2.3
1072.\}
1073\fBandroid\-gpu\-adreno3xx\fR: similarly, use this to support handling of proprietary ioctls for the Qualcomm Adreno 3XX series of GPUs on Android devices\&.
1074.RE
1075.RE
1076.PP
1077\fB\-\-merge\-recursive\-frames=<number> [default: 0] \fR
1078.RS 4
1079Some recursive algorithms, for example balanced binary tree implementations, create many different stack traces, each containing cycles of calls\&. A cycle is defined as two identical program counter values separated by zero or more other program counter values\&. Valgrind may then use a lot of memory to store all these stack traces\&. This is a poor use of memory considering that such stack traces contain repeated uninteresting recursive calls instead of more interesting information such as the function that has initiated the recursive call\&.
1080.sp
1081The option
1082\fB\-\-merge\-recursive\-frames=<number>\fR
1083instructs Valgrind to detect and merge recursive call cycles having a size of up to
1084\fB<number>\fR
1085frames\&. When such a cycle is detected, Valgrind records the cycle in the stack trace as a unique program counter\&.
1086.sp
1087The value 0 (the default) causes no recursive call merging\&. A value of 1 will cause stack traces of simple recursive algorithms (for example, a factorial implementation) to be collapsed\&. A value of 2 will usually be needed to collapse stack traces produced by recursive algorithms such as binary trees, quick sort, etc\&. Higher values might be needed for more complex recursive algorithms\&.
1088.sp
1089Note: recursive calls are detected by analysis of program counter values\&. They are not detected by looking at function names\&.
1090.RE
1091.PP
1092\fB\-\-num\-transtab\-sectors=<number> [default: 6 for Android platforms, 16 for all others] \fR
1093.RS 4
1094Valgrind translates and instruments your program\*(Aqs machine code in small fragments (basic blocks)\&. The translations are stored in a translation cache that is divided into a number of sections (sectors)\&. If the cache is full, the sector containing the oldest translations is emptied and reused\&. If these old translations are needed again, Valgrind must re\-translate and re\-instrument the corresponding machine code, which is expensive\&. If the "executed instructions" working set of a program is big, increasing the number of sectors may improve performance by reducing the number of re\-translations needed\&. Sectors are allocated on demand\&. Once allocated, a sector can never be freed, and occupies considerable space, depending on the tool and the value of
1095\fB\-\-avg\-transtab\-entry\-size\fR
1096(about 40 MB per sector for Memcheck)\&. Use the option
1097\fB\-\-stats=yes\fR
1098to obtain precise information about the memory used by a sector and the allocation and recycling of sectors\&.
1099.RE
1100.PP
1101\fB\-\-avg\-transtab\-entry\-size=<number> [default: 0, meaning use tool provided default] \fR
1102.RS 4
1103Average size of translated basic block\&. This average size is used to dimension the size of a sector\&. Each tool provides a default value to be used\&. If this default value is too small, the translation sectors will become full too quickly\&. If this default value is too big, a significant part of the translation sector memory will be unused\&. Note that the average size of a basic block translation depends on the tool, and might depend on tool options\&. For example, the memcheck option
1104\fB\-\-track\-origins=yes\fR
1105increases the size of the basic block translations\&. Use
1106\fB\-\-avg\-transtab\-entry\-size\fR
1107to tune the size of the sectors, either to gain memory or to avoid too many retranslations\&.
1108.RE
1109.PP
1110\fB\-\-aspace\-minaddr=<address> [default: depends on the platform] \fR
1111.RS 4
1112To avoid potential conflicts with some system libraries, Valgrind does not use the address space below
1113\fB\-\-aspace\-minaddr\fR
1114value, keeping it reserved in case a library specifically requests memory in this region\&. So, some "pessimistic" value is guessed by Valgrind depending on the platform\&. On linux, by default, Valgrind avoids using the first 64MB even if typically there is no conflict in this complete zone\&. You can use the option
1115\fB\-\-aspace\-minaddr\fR
1116to have your memory hungry application benefitting from more of this lower memory\&. On the other hand, if you encounter a conflict, increasing aspace\-minaddr value might solve it\&. Conflicts will typically manifest themselves with mmap failures in the low range of the address space\&. The provided
1117address
1118must be page aligned and must be equal or bigger to 0x1000 (4KB)\&. To find the default value on your platform, do something such as
1119valgrind \-d \-d date 2>&1 | grep \-i minaddr\&. Values lower than 0x10000 (64KB) are known to create problems on some distributions\&.
1120.RE
1121.PP
1122\fB\-\-valgrind\-stacksize=<number> [default: 1MB] \fR
1123.RS 4
1124For each thread, Valgrind needs its own \*(Aqprivate\*(Aq stack\&. The default size for these stacks is largely dimensioned, and so should be sufficient in most cases\&. In case the size is too small, Valgrind will segfault\&. Before segfaulting, a warning might be produced by Valgrind when approaching the limit\&.
1125.sp
1126Use the option
1127\fB\-\-valgrind\-stacksize\fR
1128if such an (unlikely) warning is produced, or Valgrind dies due to a segmentation violation\&. Such segmentation violations have been seen when demangling huge C++ symbols\&.
1129.sp
1130If your application uses many threads and needs a lot of memory, you can gain some memory by reducing the size of these Valgrind stacks using the option
1131\fB\-\-valgrind\-stacksize\fR\&.
1132.RE
1133.PP
1134\fB\-\-show\-emwarns=<yes|no> [default: no] \fR
1135.RS 4
1136When enabled, Valgrind will emit warnings about its CPU emulation in certain cases\&. These are usually not interesting\&.
1137.RE
1138.PP
1139\fB\-\-require\-text\-symbol=:sonamepatt:fnnamepatt\fR
1140.RS 4
1141When a shared object whose soname matches
1142\fIsonamepatt\fR
1143is loaded into the process, examine all the text symbols it exports\&. If none of those match
1144\fIfnnamepatt\fR, print an error message and abandon the run\&. This makes it possible to ensure that the run does not continue unless a given shared object contains a particular function name\&.
1145.sp
1146Both
1147\fIsonamepatt\fR
1148and
1149\fIfnnamepatt\fR
1150can be written using the usual
1151\fI?\fR
1152and
1153\fI*\fR
1154wildcards\&. For example:
1155\fI":*libc\&.so*:foo?bar"\fR\&. You may use characters other than a colon to separate the two patterns\&. It is only important that the first character and the separator character are the same\&. For example, the above example could also be written
1156\fI"Q*libc\&.so*Qfoo?bar"\fR\&. Multiple
1157\fI \-\-require\-text\-symbol\fR
1158flags are allowed, in which case shared objects that are loaded into the process will be checked against all of them\&.
1159.sp
1160The purpose of this is to support reliable usage of marked\-up libraries\&. For example, suppose we have a version of GCC\*(Aqs
1161\fIlibgomp\&.so\fR
1162which has been marked up with annotations to support Helgrind\&. It is only too easy and confusing to load the wrong, un\-annotated
1163\fIlibgomp\&.so\fR
1164into the application\&. So the idea is: add a text symbol in the marked\-up library, for example
1165\fIannotated_for_helgrind_3_6\fR, and then give the flag
1166\fI\-\-require\-text\-symbol=:*libgomp*so*:annotated_for_helgrind_3_6\fR
1167so that when
1168\fIlibgomp\&.so\fR
1169is loaded, Valgrind scans its symbol table, and if the symbol isn\*(Aqt present the run is aborted, rather than continuing silently with the un\-marked\-up library\&. Note that you should put the entire flag in quotes to stop shells expanding up the
1170\fI*\fR
1171and
1172\fI?\fR
1173wildcards\&.
1174.RE
1175.PP
1176\fB\-\-soname\-synonyms=syn1=pattern1,syn2=pattern2,\&.\&.\&.\fR
1177.RS 4
1178When a shared library is loaded, Valgrind checks for functions in the library that must be replaced or wrapped\&. For example, Memcheck replaces some string and memory functions (strchr, strlen, strcpy, memchr, memcpy, memmove, etc\&.) with its own versions\&. Such replacements are normally done only in shared libraries whose soname matches a predefined soname pattern (e\&.g\&.
1179\fIlibc\&.so*\fR
1180on linux)\&. By default, no replacement is done for a statically linked binary or for alternative libraries, except for the allocation functions (malloc, free, calloc, memalign, realloc, operator new, operator delete, etc\&.) Such allocation functions are intercepted by default in any shared library or in the executable if they are exported as global symbols\&. This means that if a replacement allocation library such as tcmalloc is found, its functions are also intercepted by default\&. In some cases, the replacements allow
1181\fB\-\-soname\-synonyms\fR
1182to specify one additional synonym pattern, giving flexibility in the replacement\&. Or to prevent interception of all public allocation symbols\&.
1183.sp
1184Currently, this flexibility is only allowed for the malloc related functions, using the synonym
1185\fIsomalloc\fR\&. This synonym is usable for all tools doing standard replacement of malloc related functions (e\&.g\&. memcheck, massif, drd, helgrind, exp\-dhat, exp\-sgcheck)\&.
1186.sp
1187.RS 4
1188.ie n \{\
1189\h'-04'\(bu\h'+03'\c
1190.\}
1191.el \{\
1192.sp -1
1193.IP \(bu 2.3
1194.\}
1195Alternate malloc library: to replace the malloc related functions in a specific alternate library with soname
1196\fImymalloclib\&.so\fR
1197(and not in any others), give the option
1198\fB\-\-soname\-synonyms=somalloc=mymalloclib\&.so\fR\&. A pattern can be used to match multiple libraries sonames\&. For example,
1199\fB\-\-soname\-synonyms=somalloc=*tcmalloc*\fR
1200will match the soname of all variants of the tcmalloc library (native, debug, profiled, \&.\&.\&. tcmalloc variants)\&.
1201.sp
1202Note: the soname of a elf shared library can be retrieved using the readelf utility\&.
1203.RE
1204.sp
1205.RS 4
1206.ie n \{\
1207\h'-04'\(bu\h'+03'\c
1208.\}
1209.el \{\
1210.sp -1
1211.IP \(bu 2.3
1212.\}
1213Replacements in a statically linked library are done by using the
1214\fINONE\fR
1215pattern\&. For example, if you link with
1216\fIlibtcmalloc\&.a\fR, and only want to intercept the malloc related functions in the executable (and standard libraries) themselves, but not any other shared libraries, you can give the option
1217\fB\-\-soname\-synonyms=somalloc=NONE\fR\&. Note that a NONE pattern will match the main executable and any shared library having no soname\&.
1218.RE
1219.sp
1220.RS 4
1221.ie n \{\
1222\h'-04'\(bu\h'+03'\c
1223.\}
1224.el \{\
1225.sp -1
1226.IP \(bu 2.3
1227.\}
1228To run a "default" Firefox build for Linux, in which JEMalloc is linked in to the main executable, use
1229\fB\-\-soname\-synonyms=somalloc=NONE\fR\&.
1230.RE
1231.sp
1232.RS 4
1233.ie n \{\
1234\h'-04'\(bu\h'+03'\c
1235.\}
1236.el \{\
1237.sp -1
1238.IP \(bu 2.3
1239.\}
1240To only intercept allocation symbols in the default system libraries, but not in any other shared library or the executable defining public malloc or operator new related functions use a non\-existing library name like
1241\fB\-\-soname\-synonyms=somalloc=nouserintercepts\fR
1242(where
1243\fInouserintercepts\fR
1244can be any non\-existing library name)\&.
1245.RE
1246.sp
1247.RS 4
1248.ie n \{\
1249\h'-04'\(bu\h'+03'\c
1250.\}
1251.el \{\
1252.sp -1
1253.IP \(bu 2.3
1254.\}
1255Shared library of the dynamic (runtime) linker is excluded from searching for global public symbols, such as those for the malloc related functions (identified by
1256\fIsomalloc\fR
1257synonym)\&.
1258.RE
1259.RE
1260.SH "DEBUGGING VALGRIND OPTIONS"
1261.PP
1262There are also some options for debugging Valgrind itself\&. You shouldn\*(Aqt need to use them in the normal run of things\&. If you wish to see the list, use the
1263\fB\-\-help\-debug\fR
1264option\&.
1265.SH "MEMCHECK OPTIONS"
1266.PP
1267\fB\-\-leak\-check=<no|summary|yes|full> [default: summary] \fR
1268.RS 4
1269When enabled, search for memory leaks when the client program finishes\&. If set to
1270\fIsummary\fR, it says how many leaks occurred\&. If set to
1271\fIfull\fR
1272or
1273\fIyes\fR, each individual leak will be shown in detail and/or counted as an error, as specified by the options
1274\fB\-\-show\-leak\-kinds\fR
1275and
1276\fB\-\-errors\-for\-leak\-kinds\fR\&.
1277.RE
1278.PP
1279\fB\-\-leak\-resolution=<low|med|high> [default: high] \fR
1280.RS 4
1281When doing leak checking, determines how willing Memcheck is to consider different backtraces to be the same for the purposes of merging multiple leaks into a single leak report\&. When set to
1282\fIlow\fR, only the first two entries need match\&. When
1283\fImed\fR, four entries have to match\&. When
1284\fIhigh\fR, all entries need to match\&.
1285.sp
1286For hardcore leak debugging, you probably want to use
1287\fB\-\-leak\-resolution=high\fR
1288together with
1289\fB\-\-num\-callers=40\fR
1290or some such large number\&.
1291.sp
1292Note that the
1293\fB\-\-leak\-resolution\fR
1294setting does not affect Memcheck\*(Aqs ability to find leaks\&. It only changes how the results are presented\&.
1295.RE
1296.PP
1297\fB\-\-show\-leak\-kinds=<set> [default: definite,possible] \fR
1298.RS 4
1299Specifies the leak kinds to show in a
1300\fIfull\fR
1301leak search, in one of the following ways:
1302.sp
1303.RS 4
1304.ie n \{\
1305\h'-04'\(bu\h'+03'\c
1306.\}
1307.el \{\
1308.sp -1
1309.IP \(bu 2.3
1310.\}
1311a comma separated list of one or more of
1312\fBdefinite indirect possible reachable\fR\&.
1313.RE
1314.sp
1315.RS 4
1316.ie n \{\
1317\h'-04'\(bu\h'+03'\c
1318.\}
1319.el \{\
1320.sp -1
1321.IP \(bu 2.3
1322.\}
1323\fBall\fR
1324to specify the complete set (all leak kinds)\&. It is equivalent to
1325\fB\-\-show\-leak\-kinds=definite,indirect,possible,reachable\fR\&.
1326.RE
1327.sp
1328.RS 4
1329.ie n \{\
1330\h'-04'\(bu\h'+03'\c
1331.\}
1332.el \{\
1333.sp -1
1334.IP \(bu 2.3
1335.\}
1336\fBnone\fR
1337for the empty set\&.
1338.RE
1339.RE
1340.PP
1341\fB\-\-errors\-for\-leak\-kinds=<set> [default: definite,possible] \fR
1342.RS 4
1343Specifies the leak kinds to count as errors in a
1344\fIfull\fR
1345leak search\&. The
1346\fB<set>\fR
1347is specified similarly to
1348\fB\-\-show\-leak\-kinds\fR
1349.RE
1350.PP
1351\fB\-\-leak\-check\-heuristics=<set> [default: all] \fR
1352.RS 4
1353Specifies the set of leak check heuristics to be used during leak searches\&. The heuristics control which interior pointers to a block cause it to be considered as reachable\&. The heuristic set is specified in one of the following ways:
1354.sp
1355.RS 4
1356.ie n \{\
1357\h'-04'\(bu\h'+03'\c
1358.\}
1359.el \{\
1360.sp -1
1361.IP \(bu 2.3
1362.\}
1363a comma separated list of one or more of
1364\fBstdstring length64 newarray multipleinheritance\fR\&.
1365.RE
1366.sp
1367.RS 4
1368.ie n \{\
1369\h'-04'\(bu\h'+03'\c
1370.\}
1371.el \{\
1372.sp -1
1373.IP \(bu 2.3
1374.\}
1375\fBall\fR
1376to activate the complete set of heuristics\&. It is equivalent to
1377\fB\-\-leak\-check\-heuristics=stdstring,length64,newarray,multipleinheritance\fR\&.
1378.RE
1379.sp
1380.RS 4
1381.ie n \{\
1382\h'-04'\(bu\h'+03'\c
1383.\}
1384.el \{\
1385.sp -1
1386.IP \(bu 2.3
1387.\}
1388\fBnone\fR
1389for the empty set\&.
1390.RE
1391.PP
1392Note that these heuristics are dependent on the layout of the objects produced by the C++ compiler\&. They have been tested with some gcc versions (e\&.g\&. 4\&.4 and 4\&.7)\&. They might not work properly with other C++ compilers\&.
1393.RE
1394.PP
1395\fB\-\-show\-reachable=<yes|no> \fR, \fB\-\-show\-possibly\-lost=<yes|no> \fR
1396.RS 4
1397These options provide an alternative way to specify the leak kinds to show:
1398.sp
1399.RS 4
1400.ie n \{\
1401\h'-04'\(bu\h'+03'\c
1402.\}
1403.el \{\
1404.sp -1
1405.IP \(bu 2.3
1406.\}
1407\fB\-\-show\-reachable=no \-\-show\-possibly\-lost=yes\fR
1408is equivalent to
1409\fB\-\-show\-leak\-kinds=definite,possible\fR\&.
1410.RE
1411.sp
1412.RS 4
1413.ie n \{\
1414\h'-04'\(bu\h'+03'\c
1415.\}
1416.el \{\
1417.sp -1
1418.IP \(bu 2.3
1419.\}
1420\fB\-\-show\-reachable=no \-\-show\-possibly\-lost=no\fR
1421is equivalent to
1422\fB\-\-show\-leak\-kinds=definite\fR\&.
1423.RE
1424.sp
1425.RS 4
1426.ie n \{\
1427\h'-04'\(bu\h'+03'\c
1428.\}
1429.el \{\
1430.sp -1
1431.IP \(bu 2.3
1432.\}
1433\fB\-\-show\-reachable=yes\fR
1434is equivalent to
1435\fB\-\-show\-leak\-kinds=all\fR\&.
1436.RE
1437.PP
1438Note that
1439\fB\-\-show\-possibly\-lost=no\fR
1440has no effect if
1441\fB\-\-show\-reachable=yes\fR
1442is specified\&.
1443.RE
1444.PP
1445\fB\-\-undef\-value\-errors=<yes|no> [default: yes] \fR
1446.RS 4
1447Controls whether Memcheck reports uses of undefined value errors\&. Set this to
1448\fIno\fR
1449if you don\*(Aqt want to see undefined value errors\&. It also has the side effect of speeding up Memcheck somewhat\&.
1450.RE
1451.PP
1452\fB\-\-track\-origins=<yes|no> [default: no] \fR
1453.RS 4
1454Controls whether Memcheck tracks the origin of uninitialised values\&. By default, it does not, which means that although it can tell you that an uninitialised value is being used in a dangerous way, it cannot tell you where the uninitialised value came from\&. This often makes it difficult to track down the root problem\&.
1455.sp
1456When set to
1457\fIyes\fR, Memcheck keeps track of the origins of all uninitialised values\&. Then, when an uninitialised value error is reported, Memcheck will try to show the origin of the value\&. An origin can be one of the following four places: a heap block, a stack allocation, a client request, or miscellaneous other sources (eg, a call to
1458\fIbrk\fR)\&.
1459.sp
1460For uninitialised values originating from a heap block, Memcheck shows where the block was allocated\&. For uninitialised values originating from a stack allocation, Memcheck can tell you which function allocated the value, but no more than that \-\- typically it shows you the source location of the opening brace of the function\&. So you should carefully check that all of the function\*(Aqs local variables are initialised properly\&.
1461.sp
1462Performance overhead: origin tracking is expensive\&. It halves Memcheck\*(Aqs speed and increases memory use by a minimum of 100MB, and possibly more\&. Nevertheless it can drastically reduce the effort required to identify the root cause of uninitialised value errors, and so is often a programmer productivity win, despite running more slowly\&.
1463.sp
1464Accuracy: Memcheck tracks origins quite accurately\&. To avoid very large space and time overheads, some approximations are made\&. It is possible, although unlikely, that Memcheck will report an incorrect origin, or not be able to identify any origin\&.
1465.sp
1466Note that the combination
1467\fB\-\-track\-origins=yes\fR
1468and
1469\fB\-\-undef\-value\-errors=no\fR
1470is nonsensical\&. Memcheck checks for and rejects this combination at startup\&.
1471.RE
1472.PP
1473\fB\-\-partial\-loads\-ok=<yes|no> [default: yes] \fR
1474.RS 4
1475Controls how Memcheck handles 32\-, 64\-, 128\- and 256\-bit naturally aligned loads from addresses for which some bytes are addressable and others are not\&. When
1476\fIyes\fR, such loads do not produce an address error\&. Instead, loaded bytes originating from illegal addresses are marked as uninitialised, and those corresponding to legal addresses are handled in the normal way\&.
1477.sp
1478When
1479\fIno\fR, loads from partially invalid addresses are treated the same as loads from completely invalid addresses: an illegal\-address error is issued, and the resulting bytes are marked as initialised\&.
1480.sp
1481Note that code that behaves in this way is in violation of the ISO C/C++ standards, and should be considered broken\&. If at all possible, such code should be fixed\&.
1482.RE
1483.PP
1484\fB\-\-expensive\-definedness\-checks=<yes|no> [default: no] \fR
1485.RS 4
1486Controls whether Memcheck should employ more precise but also more expensive (time consuming) algorithms when checking the definedness of a value\&. The default setting is not to do that and it is usually sufficient\&. However, for highly optimised code valgrind may sometimes incorrectly complain\&. Invoking valgrind with
1487\fB\-\-expensive\-definedness\-checks=yes\fR
1488helps but comes at a performance cost\&. Runtime degradation of 25% have been observed but the extra cost depends a lot on the application at hand\&.
1489.RE
1490.PP
1491\fB\-\-keep\-stacktraces=alloc|free|alloc\-and\-free|alloc\-then\-free|none [default: alloc\-and\-free] \fR
1492.RS 4
1493Controls which stack trace(s) to keep for malloc\*(Aqd and/or free\*(Aqd blocks\&.
1494.sp
1495With
1496\fIalloc\-then\-free\fR, a stack trace is recorded at allocation time, and is associated with the block\&. When the block is freed, a second stack trace is recorded, and this replaces the allocation stack trace\&. As a result, any "use after free" errors relating to this block can only show a stack trace for where the block was freed\&.
1497.sp
1498With
1499\fIalloc\-and\-free\fR, both allocation and the deallocation stack traces for the block are stored\&. Hence a "use after free" error will show both, which may make the error easier to diagnose\&. Compared to
1500\fIalloc\-then\-free\fR, this setting slightly increases Valgrind\*(Aqs memory use as the block contains two references instead of one\&.
1501.sp
1502With
1503\fIalloc\fR, only the allocation stack trace is recorded (and reported)\&. With
1504\fIfree\fR, only the deallocation stack trace is recorded (and reported)\&. These values somewhat decrease Valgrind\*(Aqs memory and cpu usage\&. They can be useful depending on the error types you are searching for and the level of detail you need to analyse them\&. For example, if you are only interested in memory leak errors, it is sufficient to record the allocation stack traces\&.
1505.sp
1506With
1507\fInone\fR, no stack traces are recorded for malloc and free operations\&. If your program allocates a lot of blocks and/or allocates/frees from many different stack traces, this can significantly decrease cpu and/or memory required\&. Of course, few details will be reported for errors related to heap blocks\&.
1508.sp
1509Note that once a stack trace is recorded, Valgrind keeps the stack trace in memory even if it is not referenced by any block\&. Some programs (for example, recursive algorithms) can generate a huge number of stack traces\&. If Valgrind uses too much memory in such circumstances, you can reduce the memory required with the options
1510\fI\-\-keep\-stacktraces\fR
1511and/or by using a smaller value for the option
1512\fI\-\-num\-callers\fR\&.
1513.RE
1514.PP
1515\fB\-\-freelist\-vol=<number> [default: 20000000] \fR
1516.RS 4
1517When the client program releases memory using
1518\fBfree\fR
1519(in
1520C) or
1521delete
1522(C++), that memory is not immediately made available for re\-allocation\&. Instead, it is marked inaccessible and placed in a queue of freed blocks\&. The purpose is to defer as long as possible the point at which freed\-up memory comes back into circulation\&. This increases the chance that Memcheck will be able to detect invalid accesses to blocks for some significant period of time after they have been freed\&.
1523.sp
1524This option specifies the maximum total size, in bytes, of the blocks in the queue\&. The default value is twenty million bytes\&. Increasing this increases the total amount of memory used by Memcheck but may detect invalid uses of freed blocks which would otherwise go undetected\&.
1525.RE
1526.PP
1527\fB\-\-freelist\-big\-blocks=<number> [default: 1000000] \fR
1528.RS 4
1529When making blocks from the queue of freed blocks available for re\-allocation, Memcheck will in priority re\-circulate the blocks with a size greater or equal to
1530\fB\-\-freelist\-big\-blocks\fR\&. This ensures that freeing big blocks (in particular freeing blocks bigger than
1531\fB\-\-freelist\-vol\fR) does not immediately lead to a re\-circulation of all (or a lot of) the small blocks in the free list\&. In other words, this option increases the likelihood to discover dangling pointers for the "small" blocks, even when big blocks are freed\&.
1532.sp
1533Setting a value of 0 means that all the blocks are re\-circulated in a FIFO order\&.
1534.RE
1535.PP
1536\fB\-\-workaround\-gcc296\-bugs=<yes|no> [default: no] \fR
1537.RS 4
1538When enabled, assume that reads and writes some small distance below the stack pointer are due to bugs in GCC 2\&.96, and does not report them\&. The "small distance" is 256 bytes by default\&. Note that GCC 2\&.96 is the default compiler on some ancient Linux distributions (RedHat 7\&.X) and so you may need to use this option\&. Do not use it if you do not have to, as it can cause real errors to be overlooked\&. A better alternative is to use a more recent GCC in which this bug is fixed\&.
1539.sp
1540You may also need to use this option when working with GCC 3\&.X or 4\&.X on 32\-bit PowerPC Linux\&. This is because GCC generates code which occasionally accesses below the stack pointer, particularly for floating\-point to/from integer conversions\&. This is in violation of the 32\-bit PowerPC ELF specification, which makes no provision for locations below the stack pointer to be accessible\&.
1541.sp
1542This option is deprecated as of version 3\&.12 and may be removed from future versions\&. You should instead use
1543\fB\-\-ignore\-range\-below\-sp\fR
1544to specify the exact range of offsets below the stack pointer that should be ignored\&. A suitable equivalent is
1545\fB\-\-ignore\-range\-below\-sp=1024\-1\fR\&.
1546.RE
1547.PP
1548\fB\-\-ignore\-range\-below\-sp=<number>\-<number> \fR
1549.RS 4
1550This is a more general replacement for the deprecated
1551\fB\-\-workaround\-gcc296\-bugs\fR
1552option\&. When specified, it causes Memcheck not to report errors for accesses at the specified offsets below the stack pointer\&. The two offsets must be positive decimal numbers and \-\- somewhat counterintuitively \-\- the first one must be larger, in order to imply a non\-wraparound address range to ignore\&. For example, to ignore 4 byte accesses at 8192 bytes below the stack pointer, use
1553\fB\-\-ignore\-range\-below\-sp=8192\-8189\fR\&. Only one range may be specified\&.
1554.RE
1555.PP
1556\fB\-\-show\-mismatched\-frees=<yes|no> [default: yes] \fR
1557.RS 4
1558When enabled, Memcheck checks that heap blocks are deallocated using a function that matches the allocating function\&. That is, it expects
1559\fIfree\fR
1560to be used to deallocate blocks allocated by
1561\fImalloc\fR,
1562\fIdelete\fR
1563for blocks allocated by
1564\fInew\fR, and
1565\fIdelete[]\fR
1566for blocks allocated by
1567\fInew[]\fR\&. If a mismatch is detected, an error is reported\&. This is in general important because in some environments, freeing with a non\-matching function can cause crashes\&.
1568.sp
1569There is however a scenario where such mismatches cannot be avoided\&. That is when the user provides implementations of
1570\fInew\fR/\fInew[]\fR
1571that call
1572\fImalloc\fR
1573and of
1574\fIdelete\fR/\fIdelete[]\fR
1575that call
1576\fIfree\fR, and these functions are asymmetrically inlined\&. For example, imagine that
1577\fIdelete[]\fR
1578is inlined but
1579\fInew[]\fR
1580is not\&. The result is that Memcheck "sees" all
1581\fIdelete[]\fR
1582calls as direct calls to
1583\fIfree\fR, even when the program source contains no mismatched calls\&.
1584.sp
1585This causes a lot of confusing and irrelevant error reports\&.
1586\fI\-\-show\-mismatched\-frees=no\fR
1587disables these checks\&. It is not generally advisable to disable them, though, because you may miss real errors as a result\&.
1588.RE
1589.PP
1590\fB\-\-ignore\-ranges=0xPP\-0xQQ[,0xRR\-0xSS] \fR
1591.RS 4
1592Any ranges listed in this option (and multiple ranges can be specified, separated by commas) will be ignored by Memcheck\*(Aqs addressability checking\&.
1593.RE
1594.PP
1595\fB\-\-malloc\-fill=<hexnumber> \fR
1596.RS 4
1597Fills blocks allocated by
1598malloc,
1599new, etc, but not by
1600calloc, with the specified byte\&. This can be useful when trying to shake out obscure memory corruption problems\&. The allocated area is still regarded by Memcheck as undefined \-\- this option only affects its contents\&. Note that
1601\fB\-\-malloc\-fill\fR
1602does not affect a block of memory when it is used as argument to client requests VALGRIND_MEMPOOL_ALLOC or VALGRIND_MALLOCLIKE_BLOCK\&.
1603.RE
1604.PP
1605\fB\-\-free\-fill=<hexnumber> \fR
1606.RS 4
1607Fills blocks freed by
1608free,
1609delete, etc, with the specified byte value\&. This can be useful when trying to shake out obscure memory corruption problems\&. The freed area is still regarded by Memcheck as not valid for access \-\- this option only affects its contents\&. Note that
1610\fB\-\-free\-fill\fR
1611does not affect a block of memory when it is used as argument to client requests VALGRIND_MEMPOOL_FREE or VALGRIND_FREELIKE_BLOCK\&.
1612.RE
1613.SH "CACHEGRIND OPTIONS"
1614.PP
1615\fB\-\-I1=<size>,<associativity>,<line size> \fR
1616.RS 4
1617Specify the size, associativity and line size of the level 1 instruction cache\&.
1618.RE
1619.PP
1620\fB\-\-D1=<size>,<associativity>,<line size> \fR
1621.RS 4
1622Specify the size, associativity and line size of the level 1 data cache\&.
1623.RE
1624.PP
1625\fB\-\-LL=<size>,<associativity>,<line size> \fR
1626.RS 4
1627Specify the size, associativity and line size of the last\-level cache\&.
1628.RE
1629.PP
1630\fB\-\-cache\-sim=no|yes [yes] \fR
1631.RS 4
1632Enables or disables collection of cache access and miss counts\&.
1633.RE
1634.PP
1635\fB\-\-branch\-sim=no|yes [no] \fR
1636.RS 4
1637Enables or disables collection of branch instruction and misprediction counts\&. By default this is disabled as it slows Cachegrind down by approximately 25%\&. Note that you cannot specify
1638\fB\-\-cache\-sim=no\fR
1639and
1640\fB\-\-branch\-sim=no\fR
1641together, as that would leave Cachegrind with no information to collect\&.
1642.RE
1643.PP
1644\fB\-\-cachegrind\-out\-file=<file> \fR
1645.RS 4
1646Write the profile data to
1647file
1648rather than to the default output file,
1649cachegrind\&.out\&.<pid>\&. The
1650\fB%p\fR
1651and
1652\fB%q\fR
1653format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option
1654\fB--log-file\fR\&.
1655.RE
1656.SH "CALLGRIND OPTIONS"
1657.PP
1658\fB\-\-callgrind\-out\-file=<file> \fR
1659.RS 4
1660Write the profile data to
1661file
1662rather than to the default output file,
1663callgrind\&.out\&.<pid>\&. The
1664\fB%p\fR
1665and
1666\fB%q\fR
1667format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option
1668\fB--log-file\fR\&. When multiple dumps are made, the file name is modified further; see below\&.
1669.RE
1670.PP
1671\fB\-\-dump\-line=<no|yes> [default: yes] \fR
1672.RS 4
1673This specifies that event counting should be performed at source line granularity\&. This allows source annotation for sources which are compiled with debug information (\fB\-g\fR)\&.
1674.RE
1675.PP
1676\fB\-\-dump\-instr=<no|yes> [default: no] \fR
1677.RS 4
1678This specifies that event counting should be performed at per\-instruction granularity\&. This allows for assembly code annotation\&. Currently the results can only be displayed by KCachegrind\&.
1679.RE
1680.PP
1681\fB\-\-compress\-strings=<no|yes> [default: yes] \fR
1682.RS 4
1683This option influences the output format of the profile data\&. It specifies whether strings (file and function names) should be identified by numbers\&. This shrinks the file, but makes it more difficult for humans to read (which is not recommended in any case)\&.
1684.RE
1685.PP
1686\fB\-\-compress\-pos=<no|yes> [default: yes] \fR
1687.RS 4
1688This option influences the output format of the profile data\&. It specifies whether numerical positions are always specified as absolute values or are allowed to be relative to previous numbers\&. This shrinks the file size\&.
1689.RE
1690.PP
1691\fB\-\-combine\-dumps=<no|yes> [default: no] \fR
1692.RS 4
1693When enabled, when multiple profile data parts are to be generated these parts are appended to the same output file\&. Not recommended\&.
1694.RE
1695.PP
1696\fB\-\-dump\-every\-bb=<count> [default: 0, never] \fR
1697.RS 4
1698Dump profile data every
1699\fBcount\fR
1700basic blocks\&. Whether a dump is needed is only checked when Valgrind\*(Aqs internal scheduler is run\&. Therefore, the minimum setting useful is about 100000\&. The count is a 64\-bit value to make long dump periods possible\&.
1701.RE
1702.PP
1703\fB\-\-dump\-before=<function> \fR
1704.RS 4
1705Dump when entering
1706\fBfunction\fR\&.
1707.RE
1708.PP
1709\fB\-\-zero\-before=<function> \fR
1710.RS 4
1711Zero all costs when entering
1712\fBfunction\fR\&.
1713.RE
1714.PP
1715\fB\-\-dump\-after=<function> \fR
1716.RS 4
1717Dump when leaving
1718\fBfunction\fR\&.
1719.RE
1720.PP
1721\fB\-\-instr\-atstart=<yes|no> [default: yes] \fR
1722.RS 4
1723Specify if you want Callgrind to start simulation and profiling from the beginning of the program\&. When set to
1724no, Callgrind will not be able to collect any information, including calls, but it will have at most a slowdown of around 4, which is the minimum Valgrind overhead\&. Instrumentation can be interactively enabled via
1725callgrind_control \-i on\&.
1726.sp
1727Note that the resulting call graph will most probably not contain
1728\fBmain\fR, but will contain all the functions executed after instrumentation was enabled\&. Instrumentation can also programatically enabled/disabled\&. See the Callgrind include file
1729callgrind\&.h
1730for the macro you have to use in your source code\&.
1731.sp
1732For cache simulation, results will be less accurate when switching on instrumentation later in the program run, as the simulator starts with an empty cache at that moment\&. Switch on event collection later to cope with this error\&.
1733.RE
1734.PP
1735\fB\-\-collect\-atstart=<yes|no> [default: yes] \fR
1736.RS 4
1737Specify whether event collection is enabled at beginning of the profile run\&.
1738.sp
1739To only look at parts of your program, you have two possibilities:
1740.sp
1741.RS 4
1742.ie n \{\
1743\h'-04' 1.\h'+01'\c
1744.\}
1745.el \{\
1746.sp -1
1747.IP " 1." 4.2
1748.\}
1749Zero event counters before entering the program part you want to profile, and dump the event counters to a file after leaving that program part\&.
1750.RE
1751.sp
1752.RS 4
1753.ie n \{\
1754\h'-04' 2.\h'+01'\c
1755.\}
1756.el \{\
1757.sp -1
1758.IP " 2." 4.2
1759.\}
1760Switch on/off collection state as needed to only see event counters happening while inside of the program part you want to profile\&.
1761.RE
1762.sp
1763The second option can be used if the program part you want to profile is called many times\&. Option 1, i\&.e\&. creating a lot of dumps is not practical here\&.
1764.sp
1765Collection state can be toggled at entry and exit of a given function with the option
1766\fB--toggle-collect\fR\&. If you use this option, collection state should be disabled at the beginning\&. Note that the specification of
1767\fB\-\-toggle\-collect\fR
1768implicitly sets
1769\fB\-\-collect\-state=no\fR\&.
1770.sp
1771Collection state can be toggled also by inserting the client request
1772CALLGRIND_TOGGLE_COLLECT ;
1773at the needed code positions\&.
1774.RE
1775.PP
1776\fB\-\-toggle\-collect=<function> \fR
1777.RS 4
1778Toggle collection on entry/exit of
1779\fBfunction\fR\&.
1780.RE
1781.PP
1782\fB\-\-collect\-jumps=<no|yes> [default: no] \fR
1783.RS 4
1784This specifies whether information for (conditional) jumps should be collected\&. As above, callgrind_annotate currently is not able to show you the data\&. You have to use KCachegrind to get jump arrows in the annotated code\&.
1785.RE
1786.PP
1787\fB\-\-collect\-systime=<no|yes> [default: no] \fR
1788.RS 4
1789This specifies whether information for system call times should be collected\&.
1790.RE
1791.PP
1792\fB\-\-collect\-bus=<no|yes> [default: no] \fR
1793.RS 4
1794This specifies whether the number of global bus events executed should be collected\&. The event type "Ge" is used for these events\&.
1795.RE
1796.PP
1797\fB\-\-cache\-sim=<yes|no> [default: no] \fR
1798.RS 4
1799Specify if you want to do full cache simulation\&. By default, only instruction read accesses will be counted ("Ir")\&. With cache simulation, further event counters are enabled: Cache misses on instruction reads ("I1mr"/"ILmr"), data read accesses ("Dr") and related cache misses ("D1mr"/"DLmr"), data write accesses ("Dw") and related cache misses ("D1mw"/"DLmw")\&. For more information, see
1800Cachegrind: a cache and branch-prediction profiler\&.
1801.RE
1802.PP
1803\fB\-\-branch\-sim=<yes|no> [default: no] \fR
1804.RS 4
1805Specify if you want to do branch prediction simulation\&. Further event counters are enabled: Number of executed conditional branches and related predictor misses ("Bc"/"Bcm"), executed indirect jumps and related misses of the jump address predictor ("Bi"/"Bim")\&.
1806.RE
1807.SH "HELGRIND OPTIONS"
1808.PP
1809\fB\-\-free\-is\-write=no|yes [default: no] \fR
1810.RS 4
1811When enabled (not the default), Helgrind treats freeing of heap memory as if the memory was written immediately before the free\&. This exposes races where memory is referenced by one thread, and freed by another, but there is no observable synchronisation event to ensure that the reference happens before the free\&.
1812.sp
1813This functionality is new in Valgrind 3\&.7\&.0, and is regarded as experimental\&. It is not enabled by default because its interaction with custom memory allocators is not well understood at present\&. User feedback is welcomed\&.
1814.RE
1815.PP
1816\fB\-\-track\-lockorders=no|yes [default: yes] \fR
1817.RS 4
1818When enabled (the default), Helgrind performs lock order consistency checking\&. For some buggy programs, the large number of lock order errors reported can become annoying, particularly if you\*(Aqre only interested in race errors\&. You may therefore find it helpful to disable lock order checking\&.
1819.RE
1820.PP
1821\fB\-\-history\-level=none|approx|full [default: full] \fR
1822.RS 4
1823\fB\-\-history\-level=full\fR
1824(the default) causes Helgrind collects enough information about "old" accesses that it can produce two stack traces in a race report \-\- both the stack trace for the current access, and the trace for the older, conflicting access\&. To limit memory usage, "old" accesses stack traces are limited to a maximum of 8 entries, even if
1825\fB\-\-num\-callers\fR
1826value is bigger\&.
1827.sp
1828Collecting such information is expensive in both speed and memory, particularly for programs that do many inter\-thread synchronisation events (locks, unlocks, etc)\&. Without such information, it is more difficult to track down the root causes of races\&. Nonetheless, you may not need it in situations where you just want to check for the presence or absence of races, for example, when doing regression testing of a previously race\-free program\&.
1829.sp
1830\fB\-\-history\-level=none\fR
1831is the opposite extreme\&. It causes Helgrind not to collect any information about previous accesses\&. This can be dramatically faster than
1832\fB\-\-history\-level=full\fR\&.
1833.sp
1834\fB\-\-history\-level=approx\fR
1835provides a compromise between these two extremes\&. It causes Helgrind to show a full trace for the later access, and approximate information regarding the earlier access\&. This approximate information consists of two stacks, and the earlier access is guaranteed to have occurred somewhere between program points denoted by the two stacks\&. This is not as useful as showing the exact stack for the previous access (as
1836\fB\-\-history\-level=full\fR
1837does), but it is better than nothing, and it is almost as fast as
1838\fB\-\-history\-level=none\fR\&.
1839.RE
1840.PP
1841\fB\-\-conflict\-cache\-size=N [default: 1000000] \fR
1842.RS 4
1843This flag only has any effect at
1844\fB\-\-history\-level=full\fR\&.
1845.sp
1846Information about "old" conflicting accesses is stored in a cache of limited size, with LRU\-style management\&. This is necessary because it isn\*(Aqt practical to store a stack trace for every single memory access made by the program\&. Historical information on not recently accessed locations is periodically discarded, to free up space in the cache\&.
1847.sp
1848This option controls the size of the cache, in terms of the number of different memory addresses for which conflicting access information is stored\&. If you find that Helgrind is showing race errors with only one stack instead of the expected two stacks, try increasing this value\&.
1849.sp
1850The minimum value is 10,000 and the maximum is 30,000,000 (thirty times the default value)\&. Increasing the value by 1 increases Helgrind\*(Aqs memory requirement by very roughly 100 bytes, so the maximum value will easily eat up three extra gigabytes or so of memory\&.
1851.RE
1852.PP
1853\fB\-\-check\-stack\-refs=no|yes [default: yes] \fR
1854.RS 4
1855By default Helgrind checks all data memory accesses made by your program\&. This flag enables you to skip checking for accesses to thread stacks (local variables)\&. This can improve performance, but comes at the cost of missing races on stack\-allocated data\&.
1856.RE
1857.PP
1858\fB\-\-ignore\-thread\-creation=<yes|no> [default: no]\fR
1859.RS 4
1860Controls whether all activities during thread creation should be ignored\&. By default enabled only on Solaris\&. Solaris provides higher throughput, parallelism and scalability than other operating systems, at the cost of more fine\-grained locking activity\&. This means for example that when a thread is created under glibc, just one big lock is used for all thread setup\&. Solaris libc uses several fine\-grained locks and the creator thread resumes its activities as soon as possible, leaving for example stack and TLS setup sequence to the created thread\&. This situation confuses Helgrind as it assumes there is some false ordering in place between creator and created thread; and therefore many types of race conditions in the application would not be reported\&. To prevent such false ordering, this command line option is set to
1861yes
1862by default on Solaris\&. All activity (loads, stores, client requests) is therefore ignored during:
1863.sp
1864.RS 4
1865.ie n \{\
1866\h'-04'\(bu\h'+03'\c
1867.\}
1868.el \{\
1869.sp -1
1870.IP \(bu 2.3
1871.\}
1872pthread_create() call in the creator thread
1873.RE
1874.sp
1875.RS 4
1876.ie n \{\
1877\h'-04'\(bu\h'+03'\c
1878.\}
1879.el \{\
1880.sp -1
1881.IP \(bu 2.3
1882.\}
1883thread creation phase (stack and TLS setup) in the created thread
1884.RE
1885.sp
1886Also new memory allocated during thread creation is untracked, that is race reporting is suppressed there\&. DRD does the same thing implicitly\&. This is necessary because Solaris libc caches many objects and reuses them for different threads and that confuses Helgrind\&.
1887.RE
1888.SH "DRD OPTIONS"
1889.PP
1890\fB\-\-check\-stack\-var=<yes|no> [default: no]\fR
1891.RS 4
1892Controls whether DRD detects data races on stack variables\&. Verifying stack variables is disabled by default because most programs do not share stack variables over threads\&.
1893.RE
1894.PP
1895\fB\-\-exclusive\-threshold=<n> [default: off]\fR
1896.RS 4
1897Print an error message if any mutex or writer lock has been held longer than the time specified in milliseconds\&. This option enables the detection of lock contention\&.
1898.RE
1899.PP
1900\fB\-\-join\-list\-vol=<n> [default: 10]\fR
1901.RS 4
1902Data races that occur between a statement at the end of one thread and another thread can be missed if memory access information is discarded immediately after a thread has been joined\&. This option allows to specify for how many joined threads memory access information should be retained\&.
1903.RE
1904.PP
1905\fB \-\-first\-race\-only=<yes|no> [default: no] \fR
1906.RS 4
1907Whether to report only the first data race that has been detected on a memory location or all data races that have been detected on a memory location\&.
1908.RE
1909.PP
1910\fB \-\-free\-is\-write=<yes|no> [default: no] \fR
1911.RS 4
1912Whether to report races between accessing memory and freeing memory\&. Enabling this option may cause DRD to run slightly slower\&. Notes:
1913.sp
1914.RS 4
1915.ie n \{\
1916\h'-04'\(bu\h'+03'\c
1917.\}
1918.el \{\
1919.sp -1
1920.IP \(bu 2.3
1921.\}
1922Don\*(Aqt enable this option when using custom memory allocators that use the
1923VG_USERREQ__MALLOCLIKE_BLOCK
1924and
1925VG_USERREQ__FREELIKE_BLOCK
1926because that would result in false positives\&.
1927.RE
1928.sp
1929.RS 4
1930.ie n \{\
1931\h'-04'\(bu\h'+03'\c
1932.\}
1933.el \{\
1934.sp -1
1935.IP \(bu 2.3
1936.\}
1937Don\*(Aqt enable this option when using reference\-counted objects because that will result in false positives, even when that code has been annotated properly with
1938ANNOTATE_HAPPENS_BEFORE
1939and
1940ANNOTATE_HAPPENS_AFTER\&. See e\&.g\&. the output of the following command for an example:
1941valgrind \-\-tool=drd \-\-free\-is\-write=yes drd/tests/annotate_smart_pointer\&.
1942.RE
1943.RE
1944.PP
1945\fB \-\-report\-signal\-unlocked=<yes|no> [default: yes] \fR
1946.RS 4
1947Whether to report calls to
1948\fBpthread_cond_signal\fR
1949and
1950\fBpthread_cond_broadcast\fR
1951where the mutex associated with the signal through
1952\fBpthread_cond_wait\fR
1953or
1954\fBpthread_cond_timed_wait\fRis not locked at the time the signal is sent\&. Sending a signal without holding a lock on the associated mutex is a common programming error which can cause subtle race conditions and unpredictable behavior\&. There exist some uncommon synchronization patterns however where it is safe to send a signal without holding a lock on the associated mutex\&.
1955.RE
1956.PP
1957\fB\-\-segment\-merging=<yes|no> [default: yes]\fR
1958.RS 4
1959Controls segment merging\&. Segment merging is an algorithm to limit memory usage of the data race detection algorithm\&. Disabling segment merging may improve the accuracy of the so\-called \*(Aqother segments\*(Aq displayed in race reports but can also trigger an out of memory error\&.
1960.RE
1961.PP
1962\fB\-\-segment\-merging\-interval=<n> [default: 10]\fR
1963.RS 4
1964Perform segment merging only after the specified number of new segments have been created\&. This is an advanced configuration option that allows to choose whether to minimize DRD\*(Aqs memory usage by choosing a low value or to let DRD run faster by choosing a slightly higher value\&. The optimal value for this parameter depends on the program being analyzed\&. The default value works well for most programs\&.
1965.RE
1966.PP
1967\fB\-\-shared\-threshold=<n> [default: off]\fR
1968.RS 4
1969Print an error message if a reader lock has been held longer than the specified time (in milliseconds)\&. This option enables the detection of lock contention\&.
1970.RE
1971.PP
1972\fB\-\-show\-confl\-seg=<yes|no> [default: yes]\fR
1973.RS 4
1974Show conflicting segments in race reports\&. Since this information can help to find the cause of a data race, this option is enabled by default\&. Disabling this option makes the output of DRD more compact\&.
1975.RE
1976.PP
1977\fB\-\-show\-stack\-usage=<yes|no> [default: no]\fR
1978.RS 4
1979Print stack usage at thread exit time\&. When a program creates a large number of threads it becomes important to limit the amount of virtual memory allocated for thread stacks\&. This option makes it possible to observe how much stack memory has been used by each thread of the client program\&. Note: the DRD tool itself allocates some temporary data on the client thread stack\&. The space necessary for this temporary data must be allocated by the client program when it allocates stack memory, but is not included in stack usage reported by DRD\&.
1980.RE
1981.PP
1982\fB\-\-ignore\-thread\-creation=<yes|no> [default: no]\fR
1983.RS 4
1984Controls whether all activities during thread creation should be ignored\&. By default enabled only on Solaris\&. Solaris provides higher throughput, parallelism and scalability than other operating systems, at the cost of more fine\-grained locking activity\&. This means for example that when a thread is created under glibc, just one big lock is used for all thread setup\&. Solaris libc uses several fine\-grained locks and the creator thread resumes its activities as soon as possible, leaving for example stack and TLS setup sequence to the created thread\&. This situation confuses DRD as it assumes there is some false ordering in place between creator and created thread; and therefore many types of race conditions in the application would not be reported\&. To prevent such false ordering, this command line option is set to
1985yes
1986by default on Solaris\&. All activity (loads, stores, client requests) is therefore ignored during:
1987.sp
1988.RS 4
1989.ie n \{\
1990\h'-04'\(bu\h'+03'\c
1991.\}
1992.el \{\
1993.sp -1
1994.IP \(bu 2.3
1995.\}
1996pthread_create() call in the creator thread
1997.RE
1998.sp
1999.RS 4
2000.ie n \{\
2001\h'-04'\(bu\h'+03'\c
2002.\}
2003.el \{\
2004.sp -1
2005.IP \(bu 2.3
2006.\}
2007thread creation phase (stack and TLS setup) in the created thread
2008.RE
2009.RE
2010.PP
2011\fB\-\-trace\-addr=<address> [default: none]\fR
2012.RS 4
2013Trace all load and store activity for the specified address\&. This option may be specified more than once\&.
2014.RE
2015.PP
2016\fB\-\-ptrace\-addr=<address> [default: none]\fR
2017.RS 4
2018Trace all load and store activity for the specified address and keep doing that even after the memory at that address has been freed and reallocated\&.
2019.RE
2020.PP
2021\fB\-\-trace\-alloc=<yes|no> [default: no]\fR
2022.RS 4
2023Trace all memory allocations and deallocations\&. May produce a huge amount of output\&.
2024.RE
2025.PP
2026\fB\-\-trace\-barrier=<yes|no> [default: no]\fR
2027.RS 4
2028Trace all barrier activity\&.
2029.RE
2030.PP
2031\fB\-\-trace\-cond=<yes|no> [default: no]\fR
2032.RS 4
2033Trace all condition variable activity\&.
2034.RE
2035.PP
2036\fB\-\-trace\-fork\-join=<yes|no> [default: no]\fR
2037.RS 4
2038Trace all thread creation and all thread termination events\&.
2039.RE
2040.PP
2041\fB\-\-trace\-hb=<yes|no> [default: no]\fR
2042.RS 4
2043Trace execution of the
2044ANNOTATE_HAPPENS_BEFORE(),
2045ANNOTATE_HAPPENS_AFTER()
2046and
2047ANNOTATE_HAPPENS_DONE()
2048client requests\&.
2049.RE
2050.PP
2051\fB\-\-trace\-mutex=<yes|no> [default: no]\fR
2052.RS 4
2053Trace all mutex activity\&.
2054.RE
2055.PP
2056\fB\-\-trace\-rwlock=<yes|no> [default: no]\fR
2057.RS 4
2058Trace all reader\-writer lock activity\&.
2059.RE
2060.PP
2061\fB\-\-trace\-semaphore=<yes|no> [default: no]\fR
2062.RS 4
2063Trace all semaphore activity\&.
2064.RE
2065.SH "MASSIF OPTIONS"
2066.PP
2067\fB\-\-heap=<yes|no> [default: yes] \fR
2068.RS 4
2069Specifies whether heap profiling should be done\&.
2070.RE
2071.PP
2072\fB\-\-heap\-admin=<size> [default: 8] \fR
2073.RS 4
2074If heap profiling is enabled, gives the number of administrative bytes per block to use\&. This should be an estimate of the average, since it may vary\&. For example, the allocator used by glibc on Linux requires somewhere between 4 to 15 bytes per block, depending on various factors\&. That allocator also requires admin space for freed blocks, but Massif cannot account for this\&.
2075.RE
2076.PP
2077\fB\-\-stacks=<yes|no> [default: no] \fR
2078.RS 4
2079Specifies whether stack profiling should be done\&. This option slows Massif down greatly, and so is off by default\&. Note that Massif assumes that the main stack has size zero at start\-up\&. This is not true, but doing otherwise accurately is difficult\&. Furthermore, starting at zero better indicates the size of the part of the main stack that a user program actually has control over\&.
2080.RE
2081.PP
2082\fB\-\-pages\-as\-heap=<yes|no> [default: no] \fR
2083.RS 4
2084Tells Massif to profile memory at the page level rather than at the malloc\*(Aqd block level\&. See above for details\&.
2085.RE
2086.PP
2087\fB\-\-depth=<number> [default: 30] \fR
2088.RS 4
2089Maximum depth of the allocation trees recorded for detailed snapshots\&. Increasing it will make Massif run somewhat more slowly, use more memory, and produce bigger output files\&.
2090.RE
2091.PP
2092\fB\-\-alloc\-fn=<name> \fR
2093.RS 4
2094Functions specified with this option will be treated as though they were a heap allocation function such as
2095\fBmalloc\fR\&. This is useful for functions that are wrappers to
2096\fBmalloc\fR
2097or
2098\fBnew\fR, which can fill up the allocation trees with uninteresting information\&. This option can be specified multiple times on the command line, to name multiple functions\&.
2099.sp
2100Note that the named function will only be treated this way if it is the top entry in a stack trace, or just below another function treated this way\&. For example, if you have a function
2101\fBmalloc1\fR
2102that wraps
2103\fBmalloc\fR, and
2104\fBmalloc2\fR
2105that wraps
2106\fBmalloc1\fR, just specifying
2107\fB\-\-alloc\-fn=malloc2\fR
2108will have no effect\&. You need to specify
2109\fB\-\-alloc\-fn=malloc1\fR
2110as well\&. This is a little inconvenient, but the reason is that checking for allocation functions is slow, and it saves a lot of time if Massif can stop looking through the stack trace entries as soon as it finds one that doesn\*(Aqt match rather than having to continue through all the entries\&.
2111.sp
2112Note that C++ names are demangled\&. Note also that overloaded C++ names must be written in full\&. Single quotes may be necessary to prevent the shell from breaking them up\&. For example:
2113.sp
2114.if n \{\
2115.RS 4
2116.\}
2117.nf
2118\-\-alloc\-fn=\*(Aqoperator new(unsigned, std::nothrow_t const&)\*(Aq
2119.fi
2120.if n \{\
2121.RE
2122.\}
2123.sp
2124.RE
2125.PP
2126\fB\-\-ignore\-fn=<name> \fR
2127.RS 4
2128Any direct heap allocation (i\&.e\&. a call to
2129\fBmalloc\fR,
2130\fBnew\fR, etc, or a call to a function named by an
2131\fB\-\-alloc\-fn\fR
2132option) that occurs in a function specified by this option will be ignored\&. This is mostly useful for testing purposes\&. This option can be specified multiple times on the command line, to name multiple functions\&.
2133.sp
2134Any
2135\fBrealloc\fR
2136of an ignored block will also be ignored, even if the
2137\fBrealloc\fR
2138call does not occur in an ignored function\&. This avoids the possibility of negative heap sizes if ignored blocks are shrunk with
2139\fBrealloc\fR\&.
2140.sp
2141The rules for writing C++ function names are the same as for
2142\fB\-\-alloc\-fn\fR
2143above\&.
2144.RE
2145.PP
2146\fB\-\-threshold=<m\&.n> [default: 1\&.0] \fR
2147.RS 4
2148The significance threshold for heap allocations, as a percentage of total memory size\&. Allocation tree entries that account for less than this will be aggregated\&. Note that this should be specified in tandem with ms_print\*(Aqs option of the same name\&.
2149.RE
2150.PP
2151\fB\-\-peak\-inaccuracy=<m\&.n> [default: 1\&.0] \fR
2152.RS 4
2153Massif does not necessarily record the actual global memory allocation peak; by default it records a peak only when the global memory allocation size exceeds the previous peak by at least 1\&.0%\&. This is because there can be many local allocation peaks along the way, and doing a detailed snapshot for every one would be expensive and wasteful, as all but one of them will be later discarded\&. This inaccuracy can be changed (even to 0\&.0%) via this option, but Massif will run drastically slower as the number approaches zero\&.
2154.RE
2155.PP
2156\fB\-\-time\-unit=<i|ms|B> [default: i] \fR
2157.RS 4
2158The time unit used for the profiling\&. There are three possibilities: instructions executed (i), which is good for most cases; real (wallclock) time (ms, i\&.e\&. milliseconds), which is sometimes useful; and bytes allocated/deallocated on the heap and/or stack (B), which is useful for very short\-run programs, and for testing purposes, because it is the most reproducible across different machines\&.
2159.RE
2160.PP
2161\fB\-\-detailed\-freq=<n> [default: 10] \fR
2162.RS 4
2163Frequency of detailed snapshots\&. With
2164\fB\-\-detailed\-freq=1\fR, every snapshot is detailed\&.
2165.RE
2166.PP
2167\fB\-\-max\-snapshots=<n> [default: 100] \fR
2168.RS 4
2169The maximum number of snapshots recorded\&. If set to N, for all programs except very short\-running ones, the final number of snapshots will be between N/2 and N\&.
2170.RE
2171.PP
2172\fB\-\-massif\-out\-file=<file> [default: massif\&.out\&.%p] \fR
2173.RS 4
2174Write the profile data to
2175file
2176rather than to the default output file,
2177massif\&.out\&.<pid>\&. The
2178\fB%p\fR
2179and
2180\fB%q\fR
2181format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option
2182\fB--log-file\fR\&.
2183.RE
2184.SH "SGCHECK OPTIONS"
2185.PP
2186There are no SGCheck\-specific command\-line options at present\&.
2187.SH "BBV OPTIONS"
2188.PP
2189\fB\-\-bb\-out\-file=<name> [default: bb\&.out\&.%p] \fR
2190.RS 4
2191This option selects the name of the basic block vector file\&. The
2192\fB%p\fR
2193and
2194\fB%q\fR
2195format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option
2196\fB--log-file\fR\&.
2197.RE
2198.PP
2199\fB\-\-pc\-out\-file=<name> [default: pc\&.out\&.%p] \fR
2200.RS 4
2201This option selects the name of the PC file\&. This file holds program counter addresses and function name info for the various basic blocks\&. This can be used in conjunction with the basic block vector file to fast\-forward via function names instead of just instruction counts\&. The
2202\fB%p\fR
2203and
2204\fB%q\fR
2205format specifiers can be used to embed the process ID and/or the contents of an environment variable in the name, as is the case for the core option
2206\fB--log-file\fR\&.
2207.RE
2208.PP
2209\fB\-\-interval\-size=<number> [default: 100000000] \fR
2210.RS 4
2211This option selects the size of the interval to use\&. The default is 100 million instructions, which is a commonly used value\&. Other sizes can be used; smaller intervals can help programs with finer\-grained phases\&. However smaller interval size can lead to accuracy issues due to warm\-up effects (When fast\-forwarding the various architectural features will be un\-initialized, and it will take some number of instructions before they "warm up" to the state a full simulation would be at without the fast\-forwarding\&. Large interval sizes tend to mitigate this\&.)
2212.RE
2213.PP
2214\fB\-\-instr\-count\-only [default: no] \fR
2215.RS 4
2216This option tells the tool to only display instruction count totals, and to not generate the actual basic block vector file\&. This is useful for debugging, and for gathering instruction count info without generating the large basic block vector files\&.
2217.RE
2218.SH "LACKEY OPTIONS"
2219.PP
2220\fB\-\-basic\-counts=<no|yes> [default: yes] \fR
2221.RS 4
2222When enabled, Lackey prints the following statistics and information about the execution of the client program:
2223.sp
2224.RS 4
2225.ie n \{\
2226\h'-04' 1.\h'+01'\c
2227.\}
2228.el \{\
2229.sp -1
2230.IP " 1." 4.2
2231.\}
2232The number of calls to the function specified by the
2233\fB\-\-fnname\fR
2234option (the default is
2235main)\&. If the program has had its symbols stripped, the count will always be zero\&.
2236.RE
2237.sp
2238.RS 4
2239.ie n \{\
2240\h'-04' 2.\h'+01'\c
2241.\}
2242.el \{\
2243.sp -1
2244.IP " 2." 4.2
2245.\}
2246The number of conditional branches encountered and the number and proportion of those taken\&.
2247.RE
2248.sp
2249.RS 4
2250.ie n \{\
2251\h'-04' 3.\h'+01'\c
2252.\}
2253.el \{\
2254.sp -1
2255.IP " 3." 4.2
2256.\}
2257The number of superblocks entered and completed by the program\&. Note that due to optimisations done by the JIT, this is not at all an accurate value\&.
2258.RE
2259.sp
2260.RS 4
2261.ie n \{\
2262\h'-04' 4.\h'+01'\c
2263.\}
2264.el \{\
2265.sp -1
2266.IP " 4." 4.2
2267.\}
2268The number of guest (x86, amd64, ppc, etc\&.) instructions and IR statements executed\&. IR is Valgrind\*(Aqs RISC\-like intermediate representation via which all instrumentation is done\&.
2269.RE
2270.sp
2271.RS 4
2272.ie n \{\
2273\h'-04' 5.\h'+01'\c
2274.\}
2275.el \{\
2276.sp -1
2277.IP " 5." 4.2
2278.\}
2279Ratios between some of these counts\&.
2280.RE
2281.sp
2282.RS 4
2283.ie n \{\
2284\h'-04' 6.\h'+01'\c
2285.\}
2286.el \{\
2287.sp -1
2288.IP " 6." 4.2
2289.\}
2290The exit code of the client program\&.
2291.RE
2292.RE
2293.PP
2294\fB\-\-detailed\-counts=<no|yes> [default: no] \fR
2295.RS 4
2296When enabled, Lackey prints a table containing counts of loads, stores and ALU operations, differentiated by their IR types\&. The IR types are identified by their IR name ("I1", "I8", \&.\&.\&. "I128", "F32", "F64", and "V128")\&.
2297.RE
2298.PP
2299\fB\-\-trace\-mem=<no|yes> [default: no] \fR
2300.RS 4
2301When enabled, Lackey prints the size and address of almost every memory access made by the program\&. See the comments at the top of the file
2302lackey/lk_main\&.c
2303for details about the output format, how it works, and inaccuracies in the address trace\&. Note that this option produces immense amounts of output\&.
2304.RE
2305.PP
2306\fB\-\-trace\-superblocks=<no|yes> [default: no] \fR
2307.RS 4
2308When enabled, Lackey prints out the address of every superblock (a single entry, multiple exit, linear chunk of code) executed by the program\&. This is primarily of interest to Valgrind developers\&. See the comments at the top of the file
2309lackey/lk_main\&.c
2310for details about the output format\&. Note that this option produces large amounts of output\&.
2311.RE
2312.PP
2313\fB\-\-fnname=<name> [default: main] \fR
2314.RS 4
2315Changes the function for which calls are counted when
2316\fB\-\-basic\-counts=yes\fR
2317is specified\&.
2318.RE
2319.SH "SEE ALSO"
2320.PP
2321cg_annotate(1), callgrind_annotate(1), callgrind_control(1), ms_print(1),
2322$INSTALL/share/doc/valgrind/html/index\&.html
2323or
2324http://www\&.valgrind\&.org/docs/manual/index\&.html,
2325\m[blue]\fBDebugging your program using Valgrind\*(Aqs gdbserver and GDB\fR\m[]\&\s-2\u[1]\d\s+2\m[blue]\fBvgdb\fR\m[]\&\s-2\u[2]\d\s+2,
2326\m[blue]\fBValgrind monitor commands\fR\m[]\&\s-2\u[3]\d\s+2,
2327\m[blue]\fBThe Commentary\fR\m[]\&\s-2\u[4]\d\s+2,
2328\m[blue]\fBScheduling and Multi\-Thread Performance\fR\m[]\&\s-2\u[5]\d\s+2,
2329\m[blue]\fBCachegrind: a cache and branch\-prediction profiler\fR\m[]\&\s-2\u[6]\d\s+2\&.
2330.SH "AUTHOR"
2331.PP
2332See the AUTHORS file in the valgrind distribution for a comprehensive list of authors\&.
2333.PP
2334This manpage was written by Andres Roldan <aroldan@debian\&.org> and the Valgrind developers\&.
2335.SH "NOTES"
2336.IP " 1." 4
2337Debugging your program using Valgrind's gdbserver and GDB
2338.RS 4
2339\%http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver
2340.RE
2341.IP " 2." 4
2342vgdb
2343.RS 4
2344\%http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.vgdb
2345.RE
2346.IP " 3." 4
2347Valgrind monitor commands
2348.RS 4
2349\%http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.valgrind-monitor-commands
2350.RE
2351.IP " 4." 4
2352The Commentary
2353.RS 4
2354\%http://www.valgrind.org/docs/manual/manual-core.html#manual-core.comment
2355.RE
2356.IP " 5." 4
2357Scheduling and Multi-Thread Performance
2358.RS 4
2359\%http://www.valgrind.org/docs/manual/manual-core.html#manual-core.pthreads_perf_sched
2360.RE
2361.IP " 6." 4
2362Cachegrind: a cache and branch-prediction profiler
2363.RS 4
2364\%http://www.valgrind.org/docs/manual/cg-manual.html
2365.RE