diff options
author | otto <> | 2023-12-04 07:01:45 +0000 |
---|---|---|
committer | otto <> | 2023-12-04 07:01:45 +0000 |
commit | 6e97e62c7adb0ca900dde49c141872924f78b41c (patch) | |
tree | 0bb77dcd4ea5a7d1013a0219b5cfc2aff8f2bd4e /src/lib/libc/stdlib/malloc.3 | |
parent | 872a37b58324189a9256ba4c78b1eabf7e497d47 (diff) | |
download | openbsd-6e97e62c7adb0ca900dde49c141872924f78b41c.tar.gz openbsd-6e97e62c7adb0ca900dde49c141872924f78b41c.tar.bz2 openbsd-6e97e62c7adb0ca900dde49c141872924f78b41c.zip |
Save backtraces to show in leak dump. Depth of backtrace set by
malloc option D (aka 1), 2, 3 or 4. No performance impact if not
used. ok asou@
Diffstat (limited to 'src/lib/libc/stdlib/malloc.3')
-rw-r--r-- | src/lib/libc/stdlib/malloc.3 | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/lib/libc/stdlib/malloc.3 b/src/lib/libc/stdlib/malloc.3 index 3e7f7b9876..21464dc363 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.139 2023/10/22 14:04:52 jmc Exp $ | 33 | .\" $OpenBSD: malloc.3,v 1.140 2023/12/04 07:01:45 otto Exp $ |
34 | .\" | 34 | .\" |
35 | .Dd $Mdocdate: October 22 2023 $ | 35 | .Dd $Mdocdate: December 4 2023 $ |
36 | .Dt MALLOC 3 | 36 | .Dt MALLOC 3 |
37 | .Os | 37 | .Os |
38 | .Sh NAME | 38 | .Sh NAME |
@@ -298,11 +298,12 @@ To view the leak report: | |||
298 | By default, the immediate caller of a | 298 | By default, the immediate caller of a |
299 | .Nm | 299 | .Nm |
300 | function will be recorded. | 300 | function will be recorded. |
301 | Use malloc options | 301 | Use malloc option |
302 | .Cm 2 | 302 | .Cm 2 , |
303 | or | ||
304 | .Cm 3 | 303 | .Cm 3 |
305 | to record the caller one or two stack frames deeper instead. | 304 | or |
305 | .Cm 4 | ||
306 | to record deeper call stacks. | ||
306 | These malloc options imply | 307 | These malloc options imply |
307 | .Cm D . | 308 | .Cm D . |
308 | .It Cm F | 309 | .It Cm F |
@@ -843,9 +844,10 @@ to avoid these problems on | |||
843 | .Ox . | 844 | .Ox . |
844 | .Pp | 845 | .Pp |
845 | The mechanism to record caller functions when using malloc options | 846 | The mechanism to record caller functions when using malloc options |
846 | .Cm 2 | 847 | .Cm 2 , |
848 | .Cm 3 , | ||
847 | or | 849 | or |
848 | .Cm 3 | 850 | .Cm 4 |
849 | is not guaranteed to work for all platforms, compilers or compilation | 851 | is not guaranteed to work for all platforms, compilers or compilation |
850 | options, | 852 | options, |
851 | and might even crash your program. | 853 | and might even crash your program. |