Valgrind: Difference between revisions
m (Using Valgrind moved to Valgrind: Rename) |
(→Amanda installation changes: man links) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
Valgrind is especially useful in debugging glibc errors. Errors beginning with <tt>*** glibc detected ***</tt> are errors in Amanda memory allocation detected by glibc. Please report all such problems to the [http://www.amanda.org/support/mailinglists.php amanda-hackers mailing list] or the [http://forums.zmanda.com Amanda forums]. | |||
You can disable glibc error detection by setting <tt>$MALLOC_CHECK</tt> to 1. Please note that this might cause Amanda to fail later. | |||
== Amanda installation changes== | == Amanda installation changes== | ||
* Since valgrind don't support suexec program, the easiest way to run valgrind is to configure amanda with '--with-user=root' | * Since valgrind don't support suexec program, the easiest way to run valgrind is to configure amanda with '--with-user=root' | ||
Line 10: | Line 14: | ||
libexec/runtar libexec/rundump | libexec/runtar libexec/rundump | ||
* Changes to | * Changes to {{man|5|amanda.conf}} | ||
dumpuser "root" | dumpuser "root" | ||
Latest revision as of 23:55, 30 June 2008
Valgrind is especially useful in debugging glibc errors. Errors beginning with *** glibc detected *** are errors in Amanda memory allocation detected by glibc. Please report all such problems to the amanda-hackers mailing list or the Amanda forums.
You can disable glibc error detection by setting $MALLOC_CHECK to 1. Please note that this might cause Amanda to fail later.
Amanda installation changes
- Since valgrind don't support suexec program, the easiest way to run valgrind is to configure amanda with '--with-user=root'
./configure --with-user=root ... make make install
- Remove all setuid bit
cd /install/path chmod u-s sbin/amcheck libexec/amcheck libexec/planner libexec/dumper \ libexec/runtar libexec/rundump
- Changes to amanda.conf(5)
dumpuser "root"
- Changes to /etc/xinit.d/amanda
user = root
- Create a /root/.amandahosts with the line
Amandaserver.FQDN root amdump amindexd amidxtaped
Running Amanda as superuser is not recommended.
Using valgrind
Amanda server
Simply prefix all your command with "valgrind "
valgrind /path/to/amcheck <config>
This will simply analyze the program, not it's child.
For amdump you need --trace-children=yes
valgrind --trace-children=yes /path/to/amdump <config>
Example: Following command line creates /tmp/xx.* file for each process:
valgrind --log-file=/tmp/xx --num-callers=20 --leak-check=yes \ --leak-resolution=high --freelist-vol=100000000 --trace-children=yes
Amanda client
bsd, bsdudp, bsdtcp authentication
change to /etc/xinit.d/amanda
server = /usr/bin/valgrind server_args = --log-file=/tmp/yy --num-callers=20 --leak-check=yes \ --leak-resolution=high --trace-children=yes /path/to/amandad \ -auth=YOUR-AUTH amdump amindexd amidxtaped
rsh authentication
In common-src/rsh-security.c (around line 248) Add
"valgrind", "--log-file=/tmp/xx", "--num-callers=20", "--leak-check=yes", "--leak-resolution=high", "--trace-children=yes"
between rc-hostname and xamandad_path of the execlp call.
ssh authentication
In common-src/ssh-security.c (around line 260 and 265 - 2 places) Add
"valgrind", "--log-file=/tmp/xx", "--num-callers=20", "--leak-check=yes", "--leak-resolution=high", "--trace-children=yes"
between rc-hostname and xamandad_path of the execlp call.