Note: This information is based on the state of the stable versions of Valgrind as of April 2005.
When possible, use the CVS Version of valgrind, you can access the CVS repository with the instructions found on http://valgrind.kde.org/cvs.
In comparison with the last stable version of valgrind, the CVS version allows (among other things):
- To configure the size of stack. valgrind uses mmap to load the executable images of programs it will use. Setting the base pointer of the stack allows to load bigger executables (this is useful for testing on machines with few memory). Building valgrind with the following setting:
--- configure.in 26 Feb 2005 22:14:40 +0100 1.150
+++ configure.in 06 Mar 2005 16:36:44 +0100
@@ -77,7 +77,7 @@
i?86)
AC_MSG_RESULT([ok (${host_cpu})])
VG_ARCH="x86"
- KICKSTART_BASE="0xb0000000"
+ KICKSTART_BASE="0x70000000"
ARCH_CORE_AM_CFLAGS="@PREFERRED_STACK_BOUNDARY@ -DELFSZ=32"
ARCH_TOOL_AM_CFLAGS="@PREFERRED_STACK_BOUNDARY@"
ARCH_CORE_AM_CCASFLAGS=""solves this problem.
- To work with multi-threaded programs, valgrind from the CVS doesnt need its own version of the libpthread.so.0 library anymore, so you dont need to tell the linker it should use valgrinds version of the library. I.e. with the following configuration:
$ file multithreaded_program; ldd multithreaded_program multithreaded_program: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), not stripped libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb7fcf000) libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0xb7f14000) libm.so.6 => /lib/tls/libm.so.6 (0xb7ef2000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0xb7ee9000) libc.so.6 => /lib/tls/libc.so.6 (0xb7db5000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb7fea000)
A multithreaded program will work with valgrind just fine, without touching any of the linker environment variables.
Last update: 2007-04-01 (Rev 10985)