From 629c1ad3981fcca53934c8a49351ca238bdd0318 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Fri, 13 May 2016 10:16:46 +0100 Subject: [PATCH 1/3] Add fix to ignore valgrind messages related to compressed debug symbols The glibc package recently enabled compressed debug symbols but valgrind doesn't support them yet. Results in messages like: --14923-- WARNING: Serious error when reading debug info --14923-- When reading debug info from /lib/x86_64-linux-gnu/ld-2.21.so: --14923-- Ignoring non-Dwarf2/3/4 block in .debug_info First line has 'error' in it which triggers some of the ssl-opt tests --- tests/ssl-opt.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index c08af7b04..7cf31156d 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -408,32 +408,33 @@ run_test() { # check other assertions # lines beginning with == are added by valgrind, ignore them + # lines with 'Serious error when reading debug info', are valgrind issues as well while [ $# -gt 0 ] do case $1 in "-s") - if grep -v '^==' $SRV_OUT | grep "$2" >/dev/null; then :; else + if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else fail "-s $2" return fi ;; "-c") - if grep -v '^==' $CLI_OUT | grep "$2" >/dev/null; then :; else + if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then :; else fail "-c $2" return fi ;; "-S") - if grep -v '^==' $SRV_OUT | grep "$2" >/dev/null; then + if grep -v '^==' $SRV_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then fail "-S $2" return fi ;; "-C") - if grep -v '^==' $CLI_OUT | grep "$2" >/dev/null; then + if grep -v '^==' $CLI_OUT | grep -v 'Serious error when reading debug info' | grep "$2" >/dev/null; then fail "-C $2" return fi From b8c8018343fbef0f82f128edeefb94468188a2e0 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Fri, 13 May 2016 10:33:25 +0100 Subject: [PATCH 2/3] Split test into valgrind and no-valgrind version Running valgrind on: "DTLS client reconnect from same port: reconnect, nbio" results in timeouts. New version added that runs only under valgrind. Original only runs when valgrind is not used --- tests/ssl-opt.sh | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tests/ssl-opt.sh b/tests/ssl-opt.sh index 7cf31156d..536add274 100755 --- a/tests/ssl-opt.sh +++ b/tests/ssl-opt.sh @@ -130,6 +130,13 @@ not_with_valgrind() { fi } +# skip the next test if valgrind is NOT in use +only_with_valgrind() { + if [ "$MEMCHECK" -eq 0 ]; then + SKIP_NEXT="YES" + fi +} + # multiply the client timeout delay by the given factor for the next test needs_more_time() { CLI_DELAY_FACTOR=$1 @@ -3049,13 +3056,22 @@ run_test "DTLS client reconnect from same port: reconnect" \ -S "The operation timed out" \ -s "Client initiated reconnection from same port" -run_test "DTLS client reconnect from same port: reconnect, nbio" \ +not_with_valgrind # server/client too slow to respond in time (next test has higher timeouts) +run_test "DTLS client reconnect from same port: reconnect, nbio, no valgrind" \ "$P_SRV dtls=1 exchanges=2 read_timeout=1000 nbio=2" \ "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-1000 reconnect_hard=1" \ 0 \ -S "The operation timed out" \ -s "Client initiated reconnection from same port" +only_with_valgrind # Only with valgrind, do previous test but with higher read_timeout and hs_timeout +run_test "DTLS client reconnect from same port: reconnect, nbio, valgrind" \ + "$P_SRV dtls=1 exchanges=2 read_timeout=2000 nbio=2 hs_timeout=1500-6000" \ + "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=1500-3000 reconnect_hard=1" \ + 0 \ + -S "The operation timed out" \ + -s "Client initiated reconnection from same port" + run_test "DTLS client reconnect from same port: no cookies" \ "$P_SRV dtls=1 exchanges=2 read_timeout=1000 cookies=0" \ "$P_CLI dtls=1 exchanges=2 debug_level=2 hs_timeout=500-8000 reconnect_hard=1" \ From f8e3794792a178d6addda6e72178cbb99d0d6a76 Mon Sep 17 00:00:00 2001 From: Paul Bakker Date: Fri, 13 May 2016 10:50:41 +0100 Subject: [PATCH 3/3] Update ChangeLog to reflect --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 069966041..daa6e503c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -27,6 +27,7 @@ Bugfix mbedtls_ssl_conf_curves. #373 * Fix issue in ssl_fork_server which was preventing it from functioning. #429 * Fix memory leaks in test framework + * Fix test in ssl-opt.sh that does not run properly with valgrind Changes * On ARM platforms, when compiling with -O0 with GCC, Clang or armcc5,