diff options
author | Richard Levitte <levitte@openssl.org> | 2016-02-14 14:16:52 +0300 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2016-02-14 19:22:42 +0300 |
commit | ef8ca6bd544e4baea67f9a193ae896b8629944d0 (patch) | |
tree | 3380da09bf4f1936de9e86140a596b9262bb635a /crypto/mem_dbg.c | |
parent | dda71111b88bc36a75e25787ecbe246f2620e940 (diff) |
Make the use of mdebug backtrace a separate option
To force it on anyone using --strict-warnings was the wrong move, as
this is an option best left to those who know what they're doing.
Use with care!
Reviewed-by: Andy Polyakov <appro@openssl.org>
Diffstat (limited to 'crypto/mem_dbg.c')
-rw-r--r-- | crypto/mem_dbg.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/mem_dbg.c b/crypto/mem_dbg.c index adabb2db95..b905fabfa1 100644 --- a/crypto/mem_dbg.c +++ b/crypto/mem_dbg.c @@ -116,7 +116,8 @@ #include <openssl/buffer.h> #include <openssl/bio.h> #include <openssl/lhash.h> -#if defined(CRYPTO_MDEBUG_BACKTRACE) && defined(__GNUC__) + +#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE # include <execinfo.h> #endif @@ -171,7 +172,7 @@ struct mem_st { unsigned long order; time_t time; APP_INFO *app_info; -#if defined(CRYPTO_MDEBUG_BACKTRACE) && defined(__GNUC__) +#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE void *array[30]; size_t array_siz; #endif @@ -445,7 +446,7 @@ void CRYPTO_mem_debug_malloc(void *addr, size_t num, int before_p, m->order = order; } m->order = order++; -# if defined(CRYPTO_MDEBUG_BACKTRACE) && defined(__GNUC__) +# ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE m->array_siz = backtrace(m->array, OSSL_NELEM(m->array)); # endif m->time = time(NULL); @@ -525,7 +526,7 @@ void CRYPTO_mem_debug_realloc(void *addr1, void *addr2, size_t num, if (mp != NULL) { mp->addr = addr2; mp->num = num; -#if defined(CRYPTO_MDEBUG_BACKTRACE) && defined(__GNUC__) +#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE mp->array_siz = backtrace(mp->array, OSSL_NELEM(mp->array)); #endif (void)lh_MEM_insert(mh, mp); @@ -618,7 +619,7 @@ static void print_leak(const MEM *m, MEM_LEAK *l) while (amip && !CRYPTO_THREADID_cmp(&amip->threadid, &ti)); } -#if defined(CRYPTO_MDEBUG_BACKTRACE) && defined(__GNUC__) +#ifndef OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE { size_t i; char **strings = backtrace_symbols(m->array, m->array_siz); |