summaryrefslogtreecommitdiff
path: root/.inspircd.inc
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-06-14 21:12:16 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-06-14 21:12:16 +0000
commit4e5fe6922e81c04ebb3498d8110eed3048741789 (patch)
tree5662cdd306505d769142da7d5de0ead19a56bf2c /.inspircd.inc
parent720dcd6f0e2b06dfa662eec61040d88fafb98498 (diff)
Improve valdebug-unattended: increase timeout to 90 seconds, and generate/use suppresions
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11412 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to '.inspircd.inc')
-rw-r--r--.inspircd.inc12
1 files changed, 8 insertions, 4 deletions
diff --git a/.inspircd.inc b/.inspircd.inc
index 85d7f06ad..f419d4b8a 100644
--- a/.inspircd.inc
+++ b/.inspircd.inc
@@ -201,8 +201,6 @@ sub dev_valdebug_unattended(@)
checkgdb();
# If we are still alive here.. Try starting the IRCd..
- # May want to do something with these args at some point: --suppressions=.inspircd.sup --gen-suppressions=yes
- # Could be useful when we want to stop it complaining about things we're sure aren't issues.
#
# NOTE: Saving the debug log (redirected stdout), while useful, is a potential security risk AND one hell of a spacehog. DO NOT SAVE THIS WHERE EVERYONE HAS ACCESS!
# Redirect stdout to /dev/null if you're worried about the security.
@@ -211,11 +209,17 @@ sub dev_valdebug_unattended(@)
if ($pid == 0) {
POSIX::setsid();
-d $valgrindlogpath or mkdir $valgrindlogpath or die "Cannot create $valgrindlogpath: $!\n";
+ -e "$binpath/valgrind.sup" or do { open my $f, '>', "$binpath/valgrind.sup"; };
my $suffix = strftime("%Y%m%d-%H%M%S", localtime(time)) . ".$$";
open STDIN, '<', '/dev/null' or die "Can't redirect STDIN to /dev/null: $!\n";
sysopen STDOUT, "$valgrindlogpath/out.$suffix", O_WRONLY | O_CREAT | O_NOCTTY | O_APPEND, 0600 or die "Can't open $valgrindlogpath/out.$suffix: $!\n";
sysopen STDERR, "$valgrindlogpath/valdebug.$suffix", O_WRONLY | O_CREAT | O_NOCTTY | O_APPEND, 0666 or die "Can't open $valgrindlogpath/valdebug.$suffix: $!\n";
- exec qw(valgrind -v --tool=memcheck --leak-check=yes --num-callers=10 --time-stamp=yes --log-fd=2), "$binpath/$executable", qw(-nofork -debug -nolog), @_;
+ # May want to do something with these args at some point: --suppressions=.inspircd.sup --gen-suppressions=yes
+ # Could be useful when we want to stop it complaining about things we're sure aren't issues.
+ exec qw(valgrind -v --tool=memcheck --leak-check=full --show-reachable=yes --num-callers=15 --track-fds=yes),
+ "--suppressions=$binpath/valgrind.sup", qw(--gen-suppressions=all),
+ qw(--leak-resolution=med --time-stamp=yes --log-fd=2 --),
+ "$binpath/$executable", qw(-nofork -debug -nolog), @_;
die "Can't execute valgrind: $!\n";
}
}
@@ -246,7 +250,7 @@ sub cmd_stop()
# Get to here, we have something to kill.
my $pid = getprocessid();
print "Stopping InspIRCd (pid: $pid)...\n";
- my $maxwait = (`ps -o command $pid` =~ /valgrind/i) ? 30 : 5;
+ my $maxwait = (`ps -o command $pid` =~ /valgrind/i) ? 90 : 5;
kill TERM => $pid or die "Cannot terminate IRCd: $!\n";
for (1..$maxwait) {
sleep 1;