summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-01-26 20:36:57 +0000
committerGerald Combs <gerald@wireshark.org>2013-01-26 20:36:57 +0000
commit3c66ac4b83bebd3d93b86074db48f6597cdb94cd (patch)
treefe534fd19064e0c800cb5862b132c1bbff19596d /tools
parent1cb988eb4cb6086467d344077ba9aabb0df01f8b (diff)
downloadwireshark-3c66ac4b83bebd3d93b86074db48f6597cdb94cd.tar.gz
Forward-port r47305 from trunk-1.8:
------------------------------------------------------------------------ r47305 | gerald | 2013-01-26 12:12:52 -0800 (Sat, 26 Jan 2013) | 6 lines Changed paths: M /trunk-1.8/tools/fuzz-test.sh Instead of setting resource limits on the fuzz-test.sh process itself, set limits on the TShark subprocess. This should hopefully take care of the strange fuzz failures we've seen lately. Reduce the maximum CPU time to 5 minutes while we're at it. ------------------------------------------------------------------------ svn path=/trunk/; revision=47307
Diffstat (limited to 'tools')
-rwxr-xr-xtools/fuzz-test.sh13
-rwxr-xr-xtools/randpkt-test.sh12
-rwxr-xr-xtools/test-common.sh8
3 files changed, 22 insertions, 11 deletions
diff --git a/tools/fuzz-test.sh b/tools/fuzz-test.sh
index 176fc40a31..059af29990 100755
--- a/tools/fuzz-test.sh
+++ b/tools/fuzz-test.sh
@@ -159,8 +159,17 @@ while [ \( $PASS -lt $MAX_PASSES -o $MAX_PASSES -lt 1 \) -a $DONE -ne 1 ] ; do
for ARGS in "${RUNNER_ARGS[@]}" ; do
echo -n "($ARGS) "
echo -e "Command and args: $RUNNER $ARGS\n" > $TMP_DIR/$ERR_FILE
- "$RUNNER" $ARGS $TMP_DIR/$TMP_FILE \
- > /dev/null 2>> $TMP_DIR/$ERR_FILE
+
+ # Run in a child process with limits, e.g. stop it if it's running
+ # longer then MAX_CPU_TIME seconds. (ulimit may not be supported
+ # well on some platforms, particularly cygwin.)
+ (
+ ulimit -S -t $MAX_CPU_TIME -v $MAX_VMEM -s $MAX_STACK
+ ulimit -c unlimited
+
+ "$RUNNER" $ARGS $TMP_DIR/$TMP_FILE \
+ > /dev/null 2>> $TMP_DIR/$ERR_FILE
+ )
RETVAL=$?
if [ $RETVAL -ne 0 ] ; then break ; fi
done
diff --git a/tools/randpkt-test.sh b/tools/randpkt-test.sh
index b9a8c925ef..d0aceea98f 100755
--- a/tools/randpkt-test.sh
+++ b/tools/randpkt-test.sh
@@ -81,8 +81,16 @@ while [ $PASS -lt $MAX_PASSES -o $MAX_PASSES -lt 1 ] ; do
for ARGS in "${TSHARK_ARGS[@]}" ; do
echo -n "($ARGS) "
echo -e "Command and args: $TSHARK $ARGS\n" > $TMP_DIR/$ERR_FILE
- "$TSHARK" $ARGS $TMP_DIR/$TMP_FILE \
- > /dev/null 2>> $TMP_DIR/$ERR_FILE
+
+ # Run in a child process with limits, e.g. stop it if it's running
+ # longer then MAX_CPU_TIME seconds. (ulimit may not be supported
+ # well on some platforms, particularly cygwin.)
+ (
+ ulimit -S -t $MAX_CPU_TIME -v $MAX_VMEM -s $MAX_STACK
+ ulimit -c unlimited
+ "$TSHARK" $ARGS $TMP_DIR/$TMP_FILE \
+ > /dev/null 2>> $TMP_DIR/$ERR_FILE
+ )
RETVAL=$?
if [ $RETVAL -ne 0 ] ; then break ; fi
done
diff --git a/tools/test-common.sh b/tools/test-common.sh
index c1391a4959..ee56b6e0ee 100755
--- a/tools/test-common.sh
+++ b/tools/test-common.sh
@@ -30,7 +30,7 @@ MAX_PASSES=0
# These may be set to your liking
# Stop the child process if it's running longer than x seconds
-MAX_CPU_TIME=900
+MAX_CPU_TIME=300
# Stop the child process if it's using more than y * 1024 bytes
MAX_VMEM=500000
# Stop the child process if its stack is larger than than z * 1024 bytes
@@ -53,12 +53,6 @@ if [ "$BIN_DIR" = "." ]; then
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
fi
-# set some limits to the child processes, e.g. stop it if it's running longer then MAX_CPU_TIME seconds
-# (ulimit is not supported well on cygwin and probably other platforms, e.g. cygwin shows some warnings)
-ulimit -S -t $MAX_CPU_TIME -v $MAX_VMEM -s $MAX_STACK
-ulimit -c unlimited
-
-
##############################################################################
### Set up environment variables for fuzz testing ###
##############################################################################