]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
doc/man3/OPENSSL_malloc: improve OPENSSL_MALLOC_FAILURES documentation
authorEugene Syromiatnikov <esyr@openssl.org>
Fri, 11 Jul 2025 12:24:59 +0000 (14:24 +0200)
committerNeil Horman <nhorman@openssl.org>
Tue, 29 Jul 2025 17:12:10 +0000 (13:12 -0400)
Reflect its ability to accept floating point numbers in the failure
probability specification.

Complements: 3df5736cf303 "Improve Malloc Failure Test"
Signed-off-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/28025)

doc/man3/OPENSSL_malloc.pod

index d02eb47e9a6e414002c011c6b05735d159de43a8..ec6556b765c864e049ab79afd2b0f442b2761ece 100644 (file)
@@ -167,12 +167,13 @@ respectively.  If a pointer is NULL, then the corresponding count is not stored.
 The variable
 B<OPENSSL_MALLOC_FAILURES> controls how often allocations should fail.
 It is a set of fields separated by semicolons, which each field is a count
-(defaulting to zero) and an optional atsign and percentage (defaulting
-to 100).  If the count is zero, then it lasts forever.  For example,
-C<100;@25> or C<100@0;0@25> means the first 100 allocations pass, then all
-other allocations (until the program exits or crashes) have a 25% chance of
-failing. The length of the value of B<OPENSSL_MALLOC_FAILURES> must be 256 or
-fewer characters.
+(defaulting to zero) and an optional atsign and percentage (interpreted
+as a floating point number that is rounded up to two decimal digits
+of precision, defaulting to 100).  If the count is zero, then it lasts forever.
+For example, C<100;@0.258> or C<100@0;0@0.258> means the first 100 allocations
+pass, then all other allocations (until the program exits or crashes) have
+a 0.26% chance of failing. The length of the value of B<OPENSSL_MALLOC_FAILURES>
+must be 256 or fewer characters.
 
 If the variable B<OPENSSL_MALLOC_FD> is parsed as a positive integer, then
 it is taken as an open file descriptor. This is used in conjunction with