commit a813ba75542152022a53e9104a45c702f4084df2 parent 9d55d21dc4c39a94fe1d41cff8caacb535c30fe1 Author: Anton Konyahin <me@konyahin.xyz> Date: Tue, 24 Oct 2023 14:43:49 +0300 scripts: mleak script for memory leak detection on OpenBSD Diffstat:
A | scripts/dot-bin/mleak.sh | | | 9 | +++++++++ |
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/scripts/dot-bin/mleak.sh b/scripts/dot-bin/mleak.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env sh + +set -e + +MALLOC_OPTIONS=D ktrace -tu "$1" + +echo "\nLEAKS:" +kdump -u malloc | + awk '/addr2line/{ system("addr2line " $6 " " $7 " " $8) }'