diff options
Diffstat (limited to 'src/lib/libc/stdlib/malloc.3')
| -rw-r--r-- | src/lib/libc/stdlib/malloc.3 | 74 |
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 | |||
| 315 | to record deeper call stacks. | 315 | to record deeper call stacks. |
| 316 | These malloc options imply | 316 | These malloc options imply |
| 317 | .Cm D . | 317 | .Cm D . |
| 318 | .Pp | ||
| 319 | The report begins with a header line showing the following integer variables: | ||
| 320 | .Pp | ||
| 321 | .Bl -tag -width Ds -compact | ||
| 322 | .It M | ||
| 323 | the number of pools used | ||
| 324 | .It I | ||
| 325 | internal | ||
| 326 | .Fn recallocarray | ||
| 327 | and | ||
| 328 | .Fn freezero | ||
| 329 | used (0 or 1) | ||
| 330 | .It F | ||
| 331 | whether the | ||
| 332 | .Cm F Dq freecheck | ||
| 333 | option is used (0 or 1) | ||
| 334 | .It U | ||
| 335 | whether the | ||
| 336 | .Cm U Dq free unmap | ||
| 337 | option is used (0 or 1) | ||
| 338 | .It J | ||
| 339 | the number of | ||
| 340 | .Cm J Dq junking | ||
| 341 | options used (0, 1, or 2) | ||
| 342 | .It R | ||
| 343 | whether the | ||
| 344 | .Cm R Dq realloc | ||
| 345 | option is used (0 or 1) | ||
| 346 | .It X | ||
| 347 | whether the | ||
| 348 | .Cm X Dq xmalloc | ||
| 349 | option is used (0 or 1) | ||
| 350 | .It C | ||
| 351 | whether the | ||
| 352 | .Cm C Dq canaries | ||
| 353 | option is used (0 or 1) | ||
| 354 | .It cache | ||
| 355 | the cache size in pages | ||
| 356 | .It G | ||
| 357 | the size of guard pages in bytes (0 or | ||
| 358 | .Dv MALLOC_PAGESIZE ) | ||
| 359 | .El | ||
| 360 | .Pp | ||
| 361 | The leak report consists of five columns: | ||
| 362 | .Pp | ||
| 363 | .Bl -bullet -compact | ||
| 364 | .It | ||
| 365 | the address from where the allocation function was called | ||
| 366 | .It | ||
| 367 | the total number of bytes leaked from that location | ||
| 368 | .It | ||
| 369 | the number of allocations leaked from that location | ||
| 370 | .It | ||
| 371 | the average size in bytes per leak from that location, | ||
| 372 | i.e. the quotient of the two preceding columns | ||
| 373 | .It | ||
| 374 | an | ||
| 375 | .Xr addr2line 1 | ||
| 376 | invocation using the pathname of the object file calling | ||
| 377 | the allocation function and the offset from where it is called | ||
| 378 | to find the source file name and line number of the call site | ||
| 379 | .El | ||
| 380 | .Pp | ||
| 381 | With malloc options | ||
| 382 | .Cm 2 , | ||
| 383 | .Cm 3 , | ||
| 384 | or | ||
| 385 | .Cm 4 , | ||
| 386 | each line of the leak report is followed by 1, 2, or 3 additional lines, | ||
| 387 | respectively, giving the addresses, pathnames and offsets of indirect callers. | ||
| 318 | .It Cm F | 388 | .It Cm F |
| 319 | .Dq Freecheck . | 389 | .Dq Freecheck . |
| 320 | Enable more extensive double free and write after free detection. | 390 | Enable more extensive double free and write after free detection. |
