summaryrefslogtreecommitdiff
path: root/usr/src/man/man3malloc/umem_debug.3malloc
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2020-03-27 11:29:00 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2020-03-27 11:29:00 +0000
commit6dcfbbc68f881fbf5c20d25817a0221dfb135170 (patch)
tree40307666f6d7711499061d8c4be75029a6d851e9 /usr/src/man/man3malloc/umem_debug.3malloc
parentb0624b90ec9a0c04cca626925beee3ae403457ce (diff)
parentcd62a92d4a964bfe61d35ba2301b69e65e22a509 (diff)
downloadillumos-joyent-6dcfbbc68f881fbf5c20d25817a0221dfb135170.tar.gz
[illumos-gate merge]
commit cd62a92d4a964bfe61d35ba2301b69e65e22a509 7092 Want support for stdio memory streams 12360 fwrite can loop forever on zero byte write 12392 ftello64 doesn't handle ungetc() correctly when unbuffered commit 1470234269f4edea4cbf270cb2475e4988b788d5 12359 Want a means to set the umem mtbf at runtine commit 0ac311bae7f6f50d9ba506b52bd8860f2d68d4ce 12358 Need mbrtowc variant that indicates consumed zero bytes commit d726994754c938f91b6fd7e96b5cab3829615c58 12357 getc/putc_unlocked need to set orientation
Diffstat (limited to 'usr/src/man/man3malloc/umem_debug.3malloc')
-rw-r--r--usr/src/man/man3malloc/umem_debug.3malloc16
1 files changed, 9 insertions, 7 deletions
diff --git a/usr/src/man/man3malloc/umem_debug.3malloc b/usr/src/man/man3malloc/umem_debug.3malloc
index 89fda62a80..411d15e6f0 100644
--- a/usr/src/man/man3malloc/umem_debug.3malloc
+++ b/usr/src/man/man3malloc/umem_debug.3malloc
@@ -7,14 +7,12 @@
.SH NAME
umem_debug \- debugging features of the umem library
.SH SYNOPSIS
-.LP
.nf
\fBcc\fR [ \fIflag\fR\&.\|.\|. ] \fIfile\fR\&.\|.\|. \fB-lumem\fR [ \fIlibrary\fR\&.\|.\|. ]
#include <\fBumem.h\fR>
.fi
.SH DESCRIPTION
-.LP
The \fBlibumem\fR library provides debugging features that detect memory leaks,
buffer overruns, multiple frees, use of uninitialized data, use of freed data,
and many other common programming errors. The activation of the run-time
@@ -24,6 +22,13 @@ debugging features is controlled by environment variables.
When the library detects an error, it writes a description of the error to an
internal buffer that is readable with the \fB::umem_status\fR \fBmdb\fR(1)
\fIdcmd\fR and then calls \fBabort\fR(3C).
+.sp
+.LP
+When using the debugging features of the library, a program may opt into
+changing the failure rate of memory allocation. This is often useful for
+test code that would like to force memory allocation failures in a
+controlled fashion. See the \fBumem_setmtbf\fR(3MALLOC) function for
+more information.
.SH ENVIRONMENT VARIABLES
.ne 2
.na
@@ -166,7 +171,6 @@ cannot be allocated.
.RE
.SH ATTRIBUTES
-.LP
See \fBattributes\fR(5) for descriptions of the following attributes:
.sp
@@ -183,9 +187,9 @@ MT-Level MT-Safe
.TE
.SH SEE ALSO
-.LP
\fBmdb\fR(1), \fBabort\fR(3C), \fBsignal\fR(3C),
-\fBumem_cache_create\fR(3MALLOC), \fBattributes\fR(5)
+\fBumem_cache_create\fR(3MALLOC), \fBumem_setmtbf\fR(3MALLOC),
+\fBattributes\fR(5)
.sp
.LP
\fIModular Debugger Guide\fR:
@@ -193,12 +197,10 @@ MT-Level MT-Safe
.LP
https://illumos.org/books/mdb/
.SH WARNINGS
-.LP
When \fBlibumem\fR aborts the process using \fBabort\fR(3C), any existing
signal handler for \fBSIGABRT\fR is called. If the signal handler performs
allocations, undefined behavior can result.
.SH NOTES
-.LP
Some of the debugging features work only for allocations smaller than 16
kilobytes in size. Allocations larger than 16 kilobytes could have reduced
support.