summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2026-08-22 12:22:16 +0000
committerschwarze <>2026-08-22 12:22:16 +0000
commitc7f4b07dc5ebda90f9bfdbe481120e03a75d6f7a (patch)
tree1634ab29233d5f3dc5150a701363c6a6d929b784
parent2599d45302cca4c88024c3e0867f9bf6456c179c (diff)
downloadopenbsd-c7f4b07dc5ebda90f9bfdbe481120e03a75d6f7a.tar.gz
openbsd-c7f4b07dc5ebda90f9bfdbe481120e03a75d6f7a.tar.bz2
openbsd-c7f4b07dc5ebda90f9bfdbe481120e03a75d6f7a.zip
document MALLOC_OPTIONS=D output; OK otto@
-rw-r--r--src/lib/libc/stdlib/malloc.374
1 files changed, 72 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3
index ee13b01bd4..f66bd1cbb6 100644
--- a/src/lib/libc/stdlib/malloc.3
+++ b/src/lib/libc/stdlib/malloc.3
@@ -30,9 +30,9 @@
30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31.\" SUCH DAMAGE. 31.\" SUCH DAMAGE.
32.\" 32.\"
33.\" $OpenBSD: malloc.3,v 1.147 2025/06/04 00:38:01 yasuoka Exp $ 33.\" $OpenBSD: malloc.3,v 1.148 2026/08/22 12:22:16 schwarze Exp $
34.\" 34.\"
35.Dd $Mdocdate: June 4 2025 $ 35.Dd $Mdocdate: August 22 2026 $
36.Dt MALLOC 3 36.Dt MALLOC 3
37.Os 37.Os
38.Sh NAME 38.Sh NAME
@@ -315,6 +315,76 @@ or
315to record deeper call stacks. 315to record deeper call stacks.
316These malloc options imply 316These malloc options imply
317.Cm D . 317.Cm D .
318.Pp
319The report begins with a header line showing the following integer variables:
320.Pp
321.Bl -tag -width Ds -compact
322.It M
323the number of pools used
324.It I
325internal
326.Fn recallocarray
327and
328.Fn freezero
329used (0 or 1)
330.It F
331whether the
332.Cm F Dq freecheck
333option is used (0 or 1)
334.It U
335whether the
336.Cm U Dq free unmap
337option is used (0 or 1)
338.It J
339the number of
340.Cm J Dq junking
341options used (0, 1, or 2)
342.It R
343whether the
344.Cm R Dq realloc
345option is used (0 or 1)
346.It X
347whether the
348.Cm X Dq xmalloc
349option is used (0 or 1)
350.It C
351whether the
352.Cm C Dq canaries
353option is used (0 or 1)
354.It cache
355the cache size in pages
356.It G
357the size of guard pages in bytes (0 or
358.Dv MALLOC_PAGESIZE )
359.El
360.Pp
361The leak report consists of five columns:
362.Pp
363.Bl -bullet -compact
364.It
365the address from where the allocation function was called
366.It
367the total number of bytes leaked from that location
368.It
369the number of allocations leaked from that location
370.It
371the average size in bytes per leak from that location,
372i.e. the quotient of the two preceding columns
373.It
374an
375.Xr addr2line 1
376invocation using the pathname of the object file calling
377the allocation function and the offset from where it is called
378to find the source file name and line number of the call site
379.El
380.Pp
381With malloc options
382.Cm 2 ,
383.Cm 3 ,
384or
385.Cm 4 ,
386each line of the leak report is followed by 1, 2, or 3 additional lines,
387respectively, giving the addresses, pathnames and offsets of indirect callers.
318.It Cm F 388.It Cm F
319.Dq Freecheck . 389.Dq Freecheck .
320Enable more extensive double free and write after free detection. 390Enable more extensive double free and write after free detection.