aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2016-09-21 14:43:20 -0700
committerGuy Harris <guy@alum.mit.edu>2016-09-21 21:43:52 +0000
commit876bca186bdce5bb2f3f5b3b5200ef0a83bf5683 (patch)
treeaf4a3cb0e20e9c1a6ea1e22c5f6691ee63ce972b /tools
parentec0aeb983b0efc2d2e5e24209a3a0fc198b353d2 (diff)
Add a -a flag to use if TShark was built with ASan.
We mustn't set the virtual address space limit if that's the case, as ASan consumes a ton of address space. Clean up a comment while we're at it. Change-Id: I7e88135f16b21cb091a73a35de70bee757fb3876 Reviewed-on: https://code.wireshark.org/review/17847 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/test-captures.sh21
1 files changed, 17 insertions, 4 deletions
diff --git a/tools/test-captures.sh b/tools/test-captures.sh
index 3e0410a17d..ab82c1c96e 100755
--- a/tools/test-captures.sh
+++ b/tools/test-captures.sh
@@ -30,8 +30,12 @@
TEST_TYPE="manual"
. `dirname $0`/test-common.sh || exit 1
-while getopts ":b:" OPTCHAR ; do
+# Run under AddressSanitizer ?
+ASAN=0
+
+while getopts "a:b:" OPTCHAR ; do
case $OPTCHAR in
+ a) ASAN=1 ;;
b) WIRESHARK_BIN_DIR=$OPTARG ;;
esac
done
@@ -46,12 +50,21 @@ fi
ws_bind_exec_paths
ws_check_exec "$TSHARK"
-# 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
+# Set some limits to the child processes, e.g. stop it if it's running
+# longer than MAX_CPU_TIME seconds. (ulimit is not supported well on
+# cygwin - it shows some warnings - and the features we use may not all
+# be supported on some UN*X platforms.)
+ulimit -S -t $MAX_CPU_TIME
+
# Allow core files to be generated
ulimit -c unlimited
+# Don't enable ulimit -v when using ASAN. See
+# https://github.com/google/sanitizers/wiki/AddressSanitizer#ulimit--v
+if [ $ASAN -eq 0 ]; then
+ ulimit -S -v $MAX_VMEM
+fi
+
for file in "$@"
do
echo "Testing file $file..."