diff options
author | otto <> | 2023-06-22 11:04:16 +0000 |
---|---|---|
committer | otto <> | 2023-06-22 11:04:16 +0000 |
commit | 9f41a64eb230fd1c343999400564e3e14747c3e9 (patch) | |
tree | feea18069b28cbfa101b72240970a4afce3dde4b /src/lib/libc/stdlib/malloc.3 | |
parent | 4c0df1809176af2c27699157cf128a4348f6daa5 (diff) | |
download | openbsd-9f41a64eb230fd1c343999400564e3e14747c3e9.tar.gz openbsd-9f41a64eb230fd1c343999400564e3e14747c3e9.tar.bz2 openbsd-9f41a64eb230fd1c343999400564e3e14747c3e9.zip |
Allow to ask for deeper callers for leak reports using malloc options.
ok deraadt@
Diffstat (limited to 'src/lib/libc/stdlib/malloc.3')
-rw-r--r-- | src/lib/libc/stdlib/malloc.3 | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3 index d893626051..855f217c27 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.133 2023/06/04 06:58:33 otto Exp $ | 33 | .\" $OpenBSD: malloc.3,v 1.134 2023/06/22 11:04:16 otto Exp $ |
34 | .\" | 34 | .\" |
35 | .Dd $Mdocdate: June 4 2023 $ | 35 | .Dd $Mdocdate: June 22 2023 $ |
36 | .Dt MALLOC 3 | 36 | .Dt MALLOC 3 |
37 | .Os | 37 | .Os |
38 | .Sh NAME | 38 | .Sh NAME |
@@ -294,6 +294,17 @@ To record the dump: | |||
294 | To view the leak report: | 294 | To view the leak report: |
295 | .Pp | 295 | .Pp |
296 | .Dl $ kdump -u malloc ... | 296 | .Dl $ kdump -u malloc ... |
297 | .Pp | ||
298 | By default, the immediate caller of a | ||
299 | .Nm | ||
300 | function will be recorded. | ||
301 | Use malloc options | ||
302 | .Cm 2 | ||
303 | or | ||
304 | .Cm 3 | ||
305 | to record the caller one or two stack frames deeper instead. | ||
306 | These malloc options imply | ||
307 | .Cm D . | ||
297 | .It Cm F | 308 | .It Cm F |
298 | .Dq Freecheck . | 309 | .Dq Freecheck . |
299 | Enable more extensive double free and use after free detection. | 310 | Enable more extensive double free and use after free detection. |
@@ -813,3 +824,14 @@ and | |||
813 | .Fn realloc | 824 | .Fn realloc |
814 | to avoid these problems on | 825 | to avoid these problems on |
815 | .Ox . | 826 | .Ox . |
827 | .Pp | ||
828 | The mechanism to record caller functions when using malloc options | ||
829 | .Cm 2 | ||
830 | or | ||
831 | .Cm 3 | ||
832 | is not guaranteed to work for all platforms, compilers or compilation | ||
833 | options, | ||
834 | and might even crash your program. | ||
835 | Use | ||
836 | .Em only | ||
837 | for debugging purposes. | ||