forked from wolfSSL/wolfssl
Added new build option --enable-memtest
or WOLFSSL_FORCE_MALLOC_FAIL_TEST
which enables random malloc failures for testing. This test supresses the abort()
calls to detect seg faults. A new script ./scripts/memtest.sh
starts the test. If an issue is found it can be reviewed with the ./scripts/memtest.txt
log and reproduced using the seed printed at top of unit test as --- RNG MALLOC FAIL AT 295---
and rerun using ./tests/unit.test 295
.
This commit is contained in:
@@ -13,6 +13,7 @@ if BUILD_EXAMPLE_SERVERS
|
||||
dist_noinst_SCRIPTS+= scripts/resume.test
|
||||
|
||||
EXTRA_DIST+= scripts/benchmark.test
|
||||
EXTRA_DIST+= scripts/memtest.sh
|
||||
|
||||
if BUILD_CRL
|
||||
# make revoked test rely on completion of resume test
|
||||
|
24
scripts/memtest.sh
Executable file
24
scripts/memtest.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Run this script from the wolfSSL root as `./scripts/memtest.sh`.
|
||||
|
||||
./autogen.sh
|
||||
./configure --enable-debug --disable-shared --enable-memtest \
|
||||
--enable-opensslextra --enable-des3 --enable-dh --enable-ecc --enable-aesgcm --enable-aesccm --enable-hc128 \
|
||||
--enable-sniffer --enable-psk --enable-rabbit --enable-camellia --enable-sha512 --enable-crl --enable-ocsp --enable-savesession \
|
||||
--enable-savecert --enable-atomicuser --enable-pkcallbacks --enable-scep;
|
||||
|
||||
#DTLS has issue with trapping client/server failure disconnect since its stateless. Need to find way to communicate failure through file system.
|
||||
#--enable-dtls
|
||||
make
|
||||
|
||||
for i in {1..1000}
|
||||
do
|
||||
echo "Trying $i...\n"
|
||||
|
||||
./tests/unit.test > ./scripts/memtest.txt 2>&1
|
||||
|
||||
RESULT=$?
|
||||
[ $RESULT -eq 139 ] && echo "Mem Seg Fault" && exit 1
|
||||
done
|
||||
echo "Loop SUCCESS"
|
Reference in New Issue
Block a user