public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mcheck.3, mtrace.3: update examples for glibc 2.34
@ 2023-10-24 14:31 Vincent Lefevre
  2023-10-24 15:32 ` Alejandro Colomar
  0 siblings, 1 reply; 5+ messages in thread
From: Vincent Lefevre @ 2023-10-24 14:31 UTC (permalink / raw)
  To: Michael Kerrisk, Alejandro Colomar, linux-man; +Cc: Vincent Lefevre

The glibc 2.34 NEWS file says that mtrace() and mcheck() have now been
disabled in the main C library, and preloading libc_malloc_debug.so is
needed to get this functionality back.

So the examples now need a "LD_PRELOAD=libc_malloc_debug.so".

Signed-off-by: Vincent Lefevre <vincent@vinc17.net>
---
 man3/mcheck.3 | 2 +-
 man3/mtrace.3 | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/man3/mcheck.3 b/man3/mcheck.3
index 285ea946c..e17650a4c 100644
--- a/man3/mcheck.3
+++ b/man3/mcheck.3
@@ -169,7 +169,7 @@ when running the program:
 .PP
 .in +4n
 .EX
-.RB "$" " ./a.out"
+.RB "$ " "LD_PRELOAD=libc_malloc_debug.so ./a.out"
 About to free
 \&
 About to free a second time
diff --git a/man3/mtrace.3 b/man3/mtrace.3
index f30511cd0..d0cde42c9 100644
--- a/man3/mtrace.3
+++ b/man3/mtrace.3
@@ -153,7 +153,7 @@ diagnosed memory leaks at two different locations in the program:
 .EX
 .RB "$ " "cc \-g t_mtrace.c \-o t_mtrace"
 .RB "$ " "export MALLOC_TRACE=/tmp/t"
-.RB "$ " "./t_mtrace"
+.RB "$ " "LD_PRELOAD=libc_malloc_debug.so ./t_mtrace"
 .RB "$ " "mtrace ./t_mtrace $MALLOC_TRACE"
 Memory not freed:
 -\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
-- 
2.42.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-10-24 19:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-24 14:31 [PATCH] mcheck.3, mtrace.3: update examples for glibc 2.34 Vincent Lefevre
2023-10-24 15:32 ` Alejandro Colomar
2023-10-24 16:28   ` Adhemerval Zanella Netto
2023-10-24 18:44     ` Alejandro Colomar
2023-10-24 19:28       ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox