diff options
author | Rich Salz <rsalz@akamai.com> | 2019-12-04 13:15:08 -0500 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2019-12-14 20:57:35 +0100 |
commit | 742ccab318b13a8779d9f9164d479b4a428a6da8 (patch) | |
tree | 47e5cb0544e2f74a4fbefcdd30cb65d8078f214f /test/testutil | |
parent | 4e3ee452d091615e52a43e6e7c6db7d09e260353 (diff) | |
download | openssl-742ccab318b13a8779d9f9164d479b4a428a6da8.zip openssl-742ccab318b13a8779d9f9164d479b4a428a6da8.tar.gz openssl-742ccab318b13a8779d9f9164d479b4a428a6da8.tar.bz2 |
Deprecate most of debug-memory
Fixes #8322
The leak-checking (and backtrace option, on some platforms) provided
by crypto-mdebug and crypto-mdebug-backtrace have been mostly neutered;
only the "make malloc fail" capability remains. OpenSSL recommends using
the compiler's leak-detection instead.
The OPENSSL_DEBUG_MEMORY environment variable is no longer used.
CRYPTO_mem_ctrl(), CRYPTO_set_mem_debug(), CRYPTO_mem_leaks(),
CRYPTO_mem_leaks_fp() and CRYPTO_mem_leaks_cb() return a failure code.
CRYPTO_mem_debug_{malloc,realloc,free}() have been removed. All of the
above are now deprecated.
Merge (now really small) mem_dbg.c into mem.c
Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10572)
Diffstat (limited to 'test/testutil')
-rw-r--r-- | test/testutil/driver.c | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/test/testutil/driver.c b/test/testutil/driver.c index 2ced563..030fb15 100644 --- a/test/testutil/driver.c +++ b/test/testutil/driver.c @@ -81,22 +81,6 @@ int subtest_level(void) return level; } -#ifndef OPENSSL_NO_CRYPTO_MDEBUG -static int should_report_leaks(void) -{ - /* - * When compiled with enable-crypto-mdebug, OPENSSL_DEBUG_MEMORY=0 - * can be used to disable leak checking at runtime. - * Note this only works when running the test binary manually; - * the test harness always enables OPENSSL_DEBUG_MEMORY. - */ - char *mem_debug_env = getenv("OPENSSL_DEBUG_MEMORY"); - - return mem_debug_env == NULL - || (strcmp(mem_debug_env, "0") && strcmp(mem_debug_env, "")); -} -#endif - static int gcd(int a, int b) { while (b != 0) { @@ -128,13 +112,6 @@ int setup_test_framework(int argc, char *argv[]) if (test_seed != NULL) set_seed(atoi(test_seed)); -#ifndef OPENSSL_NO_CRYPTO_MDEBUG - if (should_report_leaks()) { - CRYPTO_set_mem_debug(1); - CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); - } -#endif - #if defined(OPENSSL_SYS_VMS) && defined(__DECC) argv = copy_argv(&argc, argv); #elif defined(_WIN32) @@ -256,11 +233,6 @@ end: int pulldown_test_framework(int ret) { set_test_title(NULL); -#ifndef OPENSSL_NO_CRYPTO_MDEBUG - if (should_report_leaks() - && CRYPTO_mem_leaks_cb(openssl_error_cb, NULL) <= 0) - return EXIT_FAILURE; -#endif return ret; } |