When running system tests, named and lwresd can be run under
Valgrind. The output from Valgrind are sent to per-process files that
can be reviewed after the test has completed. To enable this, set the
-USE_VALGRIND environment variable.
+USE_VALGRIND environment variable to "helgrind" to run the Helgrind
+tool, or any other value to run the Memcheck tool. To use "helgrind"
+effectively, build BIND with --disable-atomic.
find . -type f \( \
- -name 'K*' -o -name '*~' -o -name '*.core' -o -name '*.log' \
- -o -name '*.pid' -o -name '*.keyset' -o -name named.run \
- -o -name lwresd.run -o -name ans.run \) -print | xargs rm -f
+ -name 'K*' -o -name '*~' -o -name 'core' -o -name '*.core' \
+ -o -name '*.log' -o -name '*.pid' -o -name '*.keyset' \
+ -o -name named.run -o -name lwresd.run -o -name ans.run \
+ -o -name '*-valgrind-*.log' \) -print | xargs rm -f
status=0
if ($server =~ /^ns/) {
$cleanup_files = "{*.jnl,*.bk,*.st,named.run}";
if ($ENV{'USE_VALGRIND'}) {
- $command = "valgrind -q --gen-suppressions=all --track-origins=yes --num-callers=48 --leak-check=full --fullpath-after= --log-file=named-$server-valgrind-%p.log $NAMED -m none -M external ";
+ $command = "valgrind -q --gen-suppressions=all --num-callers=48 --fullpath-after= --log-file=named-$server-valgrind-%p.log ";
+ if ($ENV{'USE_VALGRIND'} eq 'helgrind') {
+ $command .= "--tool=helgrind ";
+ } else {
+ $command .= "--tool=memcheck --track-origins=yes --leak-check=full ";
+ }
+ $command .= "$NAMED -m none -M external ";
} else {
$command = "$NAMED ";
}
} elsif ($server =~ /^lwresd/) {
$cleanup_files = "{lwresd.run}";
if ($ENV{'USE_VALGRIND'}) {
- $command = "valgrind -q --gen-suppressions=all --track-origins=yes --num-callers=48 --leak-check=full --fullpath-after= --log-file=lwresd-valgrind-%p.log $LWRESD -m none -M external ";
+ $command = "valgrind -q --gen-suppressions=all --num-callers=48 --fullpath-after= --log-file=lwresd-valgrind-%p.log ";
+ if ($ENV{'USE_VALGRIND'} eq 'helgrind') {
+ $command .= "--tool=helgrind ";
+ } else {
+ $command .= "--tool=memcheck --track-origins=yes --leak-check=full ";
+ }
+ $command .= "$LWRESD -m none -M external ";
} else {
$command = "$LWRESD ";
}
LOCK(&stats->lock);
stats->references--;
- UNLOCK(&stats->lock);
if (stats->references == 0) {
isc_mem_put(stats->mctx, stats->copiedcounters,
sizeof(isc_stat_t) * stats->ncounters);
isc_mem_put(stats->mctx, stats->counters,
sizeof(isc_stat_t) * stats->ncounters);
+ UNLOCK(&stats->lock);
DESTROYLOCK(&stats->lock);
#ifdef ISC_RWLOCK_USEATOMIC
isc_rwlock_destroy(&stats->counterlock);
#endif
isc_mem_putanddetach(&stats->mctx, stats, sizeof(*stats));
+ return;
}
+
+ UNLOCK(&stats->lock);
}
int