ovs-ctl: Add support for glibc malloc debugging.
authorBen Pfaff <blp@nicira.com>
Mon, 1 Oct 2012 20:37:47 +0000 (13:37 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 1 Oct 2012 20:37:47 +0000 (13:37 -0700)
Unlike valgrind, glibc's built-in features for malloc debugging are cheap
enough that one can run with them enabled all the time, at least in test
scenarios.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Kyle Mestery <kmestery@cisco.com>
utilities/ovs-ctl.8
utilities/ovs-lib.in

index 22db06b..8cbd3cf 100644 (file)
@@ -198,15 +198,21 @@ Run the daemon under \fBvalgrind\fR(1), if it is installed, logging to
 .IP "\fBstrace\fR"
 Run the daemon under \fBstrace\fR(1), if it is installed, logging to
 \fIdaemon\fB.strace.log.\fIpid\fR in the log directory.
 .IP "\fBstrace\fR"
 Run the daemon under \fBstrace\fR(1), if it is installed, logging to
 \fIdaemon\fB.strace.log.\fIpid\fR in the log directory.
+.
+.IP "\fBglibc\fR"
+Enable GNU C library features designed to find memory errors.
 .RE
 .
 .IP
 By default, no wrapper is used.
 .
 .IP
 .RE
 .
 .IP
 By default, no wrapper is used.
 .
 .IP
-Wrappers greatly slow daemon operations so they should not be used in
-production.  They also produce voluminous logs that can quickly fill
-small disk partitions.
+Each of the wrappers can expose bugs in Open vSwitch that lead to
+incorrect operation, including crashes.  The \fBvalgring\fR and
+\fBstrace\fR wrappers greatly slow daemon operations so they should
+not be used in production.  They also produce voluminous logs that can
+quickly fill small disk partitions.  The \fBglibc\fR wrapper is less
+resource-intensive but still somewhat slows the daemons.
 .
 .PP
 The following options control file locations.  They should only be
 .
 .PP
 The following options control file locations.  They should only be
index 01f4ded..b787b1c 100644 (file)
@@ -140,6 +140,9 @@ start_daemon () {
                 log_failure_msg "strace not installed, running $daemon without it"
             fi
             ;;
                 log_failure_msg "strace not installed, running $daemon without it"
             fi
             ;;
+        glibc)
+            set env MALLOC_CHECK_=2 MALLOC_PERTURB_=165 "$@"
+            ;;
         '')
             ;;
         *)
         '')
             ;;
         *)