[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[commit-womb] qualitycode qualitycode.texi
From: |
Ludovic Courtès |
Subject: |
[commit-womb] qualitycode qualitycode.texi |
Date: |
Fri, 19 Nov 2010 20:50:54 +0000 |
CVSROOT: /sources/womb
Module name: qualitycode
Changes by: Ludovic Courtès <civodul> 10/11/19 20:50:49
Modified files:
. : qualitycode.texi
Log message:
Augment "Memory Management" section with stubs.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/qualitycode/qualitycode.texi?cvsroot=womb&r1=1.2&r2=1.3
Patches:
Index: qualitycode.texi
===================================================================
RCS file: /sources/womb/qualitycode/qualitycode.texi,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- qualitycode.texi 19 Nov 2010 05:29:31 -0000 1.2
+++ qualitycode.texi 19 Nov 2010 20:50:49 -0000 1.3
@@ -1,5 +1,5 @@
\input texinfo @c -*-texinfo-*-
address@hidden $Id: qualitycode.texi,v 1.2 2010/11/19 05:29:31 jas Exp $
address@hidden $Id: qualitycode.texi,v 1.3 2010/11/19 20:50:49 civodul Exp $
@comment %**start of header
@setfilename qualitycode.info
@set UPDATED 18 November 2010
@@ -52,21 +52,31 @@
@end ifnottex
@menu
-* Memory management::
+* Memory Management::
* GNU Free Documentation License::
* Index::
@end menu
address@hidden Memory management
address@hidden Memory management
address@hidden Memory Management
address@hidden Memory Management
-xxx Ludo: pointers to GCC's Mudflap and -fstack-protector.
-
-Of course, many languages are memory-safe, such as GNU Guile.
+C, C++, and similar languages let programmers in charge of managing
+memory and ensuring that application code does not access invalid memory
+regions. This section describes common tools and techniques to test the
+memory management discipline of such programs and help find out and
+debug problems.
+
+Of course, many languages provide automatic memory management thanks to
+a @dfn{garbage collector}, and guarantee that application code can only
+access memory regions that contain valid objects. Among them is GNU
+Guile, the extension language of the GNU System (@pxref{Introduction,,,
+guile, GNU Guile Reference Manual}).
@menu
-* Valgrind::
+* Valgrind:: Run-time memory management analysis.
+* Compiler Support:: GCC support for debugging memory issues.
+* C Library Support:: GNU C Library support.
@end menu
@@ -75,7 +85,7 @@
@pindex valgrind
-Valgrind (@url{http://valgrind.org}) is a dynamic analysis tool,
address@hidden://valgrind.org, Valgrind} is a dynamic analysis tool,
meaning it is used during runtime, without any re-compilation. It is
typically only useful to check compiled languages that support
low-level memory management, such as C and C++. Valgrind can find
@@ -88,7 +98,13 @@
It runs Valgrind with its default analysis tool, @code{memcheck},
which reports memory management and access errors in a human-readable
-way.
+way. With the @code{--leak-check=full} option, Valgrind and
address@hidden also report memory leaks.
+
+Valgrind has the advantage that applications do not need to be
+recompiled or relinked. However, since Valgrind is a hardware
+simulator, it runs programs 20 to 100 times more slowly than the raw
+hardware.
@subheading Automatic use of Valgrind for self-checks
@@ -110,6 +126,45 @@
serious bug will trigger an error message.
address@hidden Compiler Support
address@hidden Compiler Support
+
address@hidden FIXME: Incomplete.
+The GNU Compiler Collection provides support for detecting common memory
+errors at run-time:
+
address@hidden
address@hidden
+Mudflap, which instruments memory accesses (@pxref{Optimize Options,
address@hidden,, gcc, GCC Reference Manual}).
+
address@hidden
address@hidden (@pxref{Optimize Options,
address@hidden,, gcc, GCC Reference Manual}).
address@hidden enumerate
+
+
address@hidden C Library Support
address@hidden C Library Support
+
address@hidden FIXME: Incomplete.
address@hidden
address@hidden
address@hidden, to detect heap consistency errors, such as buffer
+overruns (@pxref{Heap Consistency Checking, @code{MALLOC_CHECK_},, libc,
+The GNU C Library Reference Manual}).
+
address@hidden
address@hidden, which can be used to force initialization of the
+heap to a given value, thereby helping find out accesses to
+uninitialized memory regions.
address@hidden itemize
+
+
address@hidden TODO: Mention ``Using the Garbage Collector as Leak Detector''?
address@hidden http://www.hpl.hp.com/personal/Hans_Boehm/gc/leak.html
+
+
@node GNU Free Documentation License
@appendix GNU Free Documentation License