Valgrind-HOWTO.pdf
(
55 KB
)
Pobierz
Valgrind HOWTO
Valgrind HOWTO
Deepak P.
pdeepak16@vsnl.com
Sandeep S.
sandeep_gect@yahoo.com
24 August 2002
Revision History
Revision 1.1
2002−09−15
Revised by: tab
Converted to XML 4.1.2, added gfdl, reviewed, author revisions
Revision 1.0
2002−08−24
Revised by: SS
Initial release
This document is a guide to Valgrind, the
malloc
debugger. Valgrind 1.0.0 is described.
Valgrind HOWTO
Table of Contents
1. Background
.....................................................................................................................................................1
2. Introduction.
....................................................................................................................................................2
2.1. Purpose.
.............................................................................................................................................2
2.2. Acknowledgments..
...........................................................................................................................2
2.3. Copyright and Distribution Policy.
...................................................................................................2
2.4. Feedback and Corrections.
................................................................................................................2
3. Getting it Installed.
.........................................................................................................................................3
3.1. Getting Valgrind.
..............................................................................................................................3
3.2. Installing.
..........................................................................................................................................3
4. A Closer View.
.................................................................................................................................................4
4.1. Why Valgrind?.
.................................................................................................................................4
4.2. Usage..
...............................................................................................................................................4
4.2.1. Invoking Valgrind.
..................................................................................................................4
4.2.2. How to Identify the Error from the Error Report.
...................................................................4
4.2.3. Types of Errors with Examples.
..............................................................................................5
4.2.4. How to Suppress Errors.
..........................................................................................................8
4.3. Limitations and Dependencies of Valgrind..
....................................................................................9
5. Let's Go Deeper.
............................................................................................................................................10
5.1. How Valgrind Tracks Validity of Each Byte.
.................................................................................10
5.2. Cache Profiling.
..............................................................................................................................11
6. Concluding Remarks.
...................................................................................................................................14
7. References.
.....................................................................................................................................................15
A. GNU Free Documentation License.
............................................................................................................16
A.1. PREAMBLE.
.............................................................................................................................................17
A.2. APPLICABILITY AND DEFINITIONS.
...............................................................................................18
A.3. VERBATIM COPYING.
..........................................................................................................................19
A.4. COPYING IN QUANTITY.
.....................................................................................................................20
A.5. MODIFICATIONS.
..................................................................................................................................21
A.6. COMBINING DOCUMENTS.
................................................................................................................23
A.7. COLLECTIONS OF DOCUMENTS.
.....................................................................................................24
A.8. AGGREGATION WITH INDEPENDENT WORKS.
..........................................................................25
i
Valgrind HOWTO
Table of Contents
A.9. TRANSLATION
.......................................................................................................................................26
A.10. TERMINATION.
....................................................................................................................................27
A.11. FUTURE REVISIONS OF THIS LICENSE.
.......................................................................................28
A.12. How to use this License for your documents.
.......................................................................................29
ii
1. Background
Dynamic storage allocation plays an important role in C programming; it is also the breeding ground of
numerous hard−to−track−down bugs. Freeing an allocated block twice, running off the edge of the malloc'ed
buffer, and failing to keep track of addresses of allocated blocks are common errors which frustrate the
programmer − debugging them is very difficult due to the errors manifesting themselves as "mysterious
behavior" at places far off from the point where the programmer actually committed the blunder.
1. Background
1
2. Introduction
2.1. Purpose
Valgrind is an open−source tool for finding memory−management problems in Linux−x86 executables. It
detects memory leaks/corruption in the program being run. It is being developed by
Julian Seward
.
2.2. Acknowledgments
We express our sincere appreciation to Julian Seward for creating Valgrind. Thanks to Mr.Pramode C.E and
also friends at the Govt Engineering College, Trichur for their advice and cooperation.
2.3. Copyright and Distribution Policy
Copyright (C)2002 Deepak P, Sandeep S.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free
Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no
Invariant Sections, with no Front−Cover Texts, and no Back−Cover Texts. A copy of the license is included
in
Appendix A
entitled "GNU Free Documentation License".
2.4. Feedback and Corrections
Kindly forward feedback and criticism to
Deepak.P
or/and
Sandeep.S
.
We shall be indebted to anybody who
points out errors and inaccuracies in this document; we will rectify them as soon as we are informed.
2. Introduction
2
Plik z chomika:
megaskrypty
Inne pliki z tego folderu:
3-Button-Mouse(1).pdf
(58 KB)
XWindow-Overview-HOWTO(1).pdf
(30 KB)
Xterm-Title(1).pdf
(39 KB)
Xterminals(1).pdf
(30 KB)
Xinerama-HOWTO(1).pdf
(33 KB)
Inne foldery tego chomika:
Programowanie
Zgłoś jeśli
naruszono regulamin