OpenBSD Journal

malloc(3) leak detection gains backtraces

Contributed by rueda on from the ottomalloc-has-your-back(trace) dept.

Otto Moerbeek (otto@), the author of OpenBSD's malloc(3) implementation, has comitted another great feature - backtraces for leak detection:

CVSROOT:	/cvs
Module name:	src
Changes by:	otto@cvs.openbsd.org	2023/12/04 00:01:45

Modified files:
	lib/libc/stdlib: malloc.3 malloc.c 

Log message:
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@

Otto's original message to tech@ includes an example use of the feature.

(Comments are closed)


Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]