RPM Package Manager, CVS Repository
http://rpm5.org/cvs/
____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall
Root: /v/rpm/cvs Email: rse@rpm5.org
Module: rpm Date: 19-Jul-2007 10:37:48
Branch: HEAD Handle: 2007071909374800
Modified files:
rpm INSTALL
Log:
document how RPM 5 can be debugged with DMalloc
Summary:
Revision Changes Path
2.35 +58 -0 rpm/INSTALL
____________________________________________________________________________
patch -p0 <<'@@ .'
Index: rpm/INSTALL
============================================================================
$ cvs diff -u -r2.34 -r2.35 INSTALL
--- rpm/INSTALL 17 Jul 2007 07:25:05 -0000 2.34
+++ rpm/INSTALL 19 Jul 2007 08:37:48 -0000 2.35
@@ -283,6 +283,64 @@
implementation please at least make sure that the above issues are still
taken care of and especially test it under _different_ Unix flavors.
+DEBUGGING
+=========
+
+Memory Allocation Debugging with DMalloc
+----------------------------------------
+
+1. Install DMalloc into /path/to/dmalloc
+
+2. Build RPM with at least:
+
+ $ ./configure [...]
+ --prefix=/tmp/rpm \
+ --with-dmalloc=/path/to/dmalloc
+ [...]
+ $ make
+ $ make install
+
+3. Create a ~/.dmallocrc containing:
+
+ # no debugging
+ none none
+
+ # basic debugging
+ debug1 log-stats, log-non-free, check-fence
+
+ # more logging and some heap checking
+ debug2 log-stats, log-non-free, check-fence, \
+ log-trans, check-heap
+
+ # good utilities
+ debug3 log-stats, log-non-free, check-fence, \
+ log-trans, check-heap, \
+ log-admin, realloc-copy, free-blank
+
+ # even more good utilities
+ debug4 log-stats, log-non-free, check-fence, \
+ log-trans, check-heap, \
+ log-admin, realloc-copy, free-blank, \
+ log-bad-space, log-nonfree-space
+
+4. Enable dmalloc debugging with:
+
+ $ dmalloc -l dmalloc.log
+ $ dmalloc debug3
+
+5. Run RPM:
+
+ $ /tmp/rpm/bin/rpm [...]
+
+6. Inspect the results:
+ (notice that some used functions like gethostbyname(3) or dirname(3)
+ from the vendor libc inherently leak memory because of their API
+ style and because libc isn't DMalloc instrumented you will often see
+ some memory leaks reported without any source location -- just be not
+ confused)
+
+ $ vi dmalloc.log
+
OS DEPENDENCIES
===============
@@ .
Received on Thu Jul 19 10:37:48 2007