aboutsummaryrefslogtreecommitdiff
path: root/doc/man3/OPENSSL_malloc.pod
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2022-08-09 11:55:45 +0100
committerTomas Mraz <tomas@openssl.org>2022-08-17 12:58:41 +0200
commit5a07d91dc9e787e5e4a2ff5b41bc0ebdcb4efd0a (patch)
tree59d5b053da80266833fa3fe671d2085f6dc68a26 /doc/man3/OPENSSL_malloc.pod
parent8bb9fecf6341aad0a771bf585d9eea80ea6ac89d (diff)
downloadopenssl-5a07d91dc9e787e5e4a2ff5b41bc0ebdcb4efd0a.zip
openssl-5a07d91dc9e787e5e4a2ff5b41bc0ebdcb4efd0a.tar.gz
openssl-5a07d91dc9e787e5e4a2ff5b41bc0ebdcb4efd0a.tar.bz2
Correct the documentation for OPENSSL_MALLOC_FD
The documentation was misleading in that it suggests that this environment variable will record information about all allocations. While this is true it doesn't record the most useful information that you might expect such as the requested size of the allocation! It is mainly for use in conjunction with OPENSSL_MALLOC_FAILURES, and reports information about what chance an allocation has of failing. We also clarify that the mem_debug functions are actually no-ops in 3.0. Reviewed-by: Hugo Landau <hlandau@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18967) (cherry picked from commit 2c35d61790603530d11f52eda9132ff8640f9852)
Diffstat (limited to 'doc/man3/OPENSSL_malloc.pod')
-rw-r--r--doc/man3/OPENSSL_malloc.pod17
1 files changed, 9 insertions, 8 deletions
diff --git a/doc/man3/OPENSSL_malloc.pod b/doc/man3/OPENSSL_malloc.pod
index 99a76e0..7dc6468 100644
--- a/doc/man3/OPENSSL_malloc.pod
+++ b/doc/man3/OPENSSL_malloc.pod
@@ -149,12 +149,12 @@ other allocations (until the program exits or crashes) have a 25% chance of
failing.
If the variable B<OPENSSL_MALLOC_FD> is parsed as a positive integer, then
-it is taken as an open file descriptor, and a record of all allocations is
-written to that descriptor. If an allocation will fail, and the platform
-supports it, then a backtrace will be written to the descriptor. This can
-be useful because a malloc may fail but not be checked, and problems will
-only occur later. The following example in classic shell syntax shows how
-to use this (will not work on all platforms):
+it is taken as an open file descriptor. This is used in conjunction with
+B<OPENSSL_MALLOC_FAILURES> described above. For every allocation it will log
+details about how many allocations there have been so far, what percentage
+chance there is for this allocation failing, and whether it has actually failed.
+The following example in classic shell syntax shows how to use this (will not
+work on all platforms):
OPENSSL_MALLOC_FAILURES='200;@10'
export OPENSSL_MALLOC_FAILURES
@@ -179,10 +179,11 @@ CRYPTO_set_mem_functions() returns 1 on success or 0 on failure (almost
always because allocations have already happened).
CRYPTO_mem_leaks(), CRYPTO_mem_leaks_fp(), CRYPTO_mem_leaks_cb(),
-CRYPTO_set_mem_debug(), and CRYPTO_mem_ctrl() are deprecated and return -1.
+CRYPTO_set_mem_debug(), and CRYPTO_mem_ctrl() are deprecated and are no-ops that
+always return -1.
OPENSSL_mem_debug_push(), OPENSSL_mem_debug_pop(),
CRYPTO_mem_debug_push(), and CRYPTO_mem_debug_pop()
-are deprecated and return 0.
+are deprecated and are no-ops that always return 0.
=head1 HISTORY