Hi Vincent, On Tue, Oct 24, 2023 at 04:31:17PM +0200, Vincent Lefevre wrote: > 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 Can you please clarify "disabled"? What is the behavior if that library is not preloaded? My attempt to run this program is that mcheck(3) returns -1. So, the preload interposes the dummy function that only returns -1 with an actual mcheck(3) implementation? Are these functions deprecated by glibc? If so, we should probably use [[deprecated]] in the SYNOPSIS. Or did they just move the functionality for other reasons but without deprecating? Should we document the need for LD_PRELOAD in the LIBRARY section? Thanks, Alex > needed to get this functionality back. > > So the examples now need a "LD_PRELOAD=libc_malloc_debug.so". > > Signed-off-by: Vincent Lefevre <vincent@xxxxxxxxxx> > --- > 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 > -- <https://www.alejandro-colomar.es/>
Attachment:
signature.asc
Description: PGP signature