This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] malloc: Deprecate hook variables, __default_morecore, <mcheck.h>


On Thu, 17 Nov 2016, Florian Weimer wrote:

> > Well, I think mtrace (meaning the ability to run with tracing then run the
> > mtrace script to process the results, more than the functions to turn
> > tracing on and off) is similarly useful externally as a lightweight system
> > for tracing allocations and detecting leaks.  And it is of course
> > documented in the manual.
> 
> In my experience, it is not useful at all for finding the cause of leaks
> because you only get the address of the immediate caller of malloc, which is
> often a wrapper.  The address is subject to ASLR as well.
> 
> Based on the comments in this thread, I'm not sure if people find mtrace
> theoretically useful, or actually use it. :)

I use it for similar purposes to the glibc testsuite use: compile code 
once then possibly run it with tracing to check for leaks.  (Where the 
expectation is that the cause of the leak is in the code you just 
added/changed that resulted in the check for leaks starting to fail.)

I'd be fine with extending the trace format to allow listing more of a 
backtrace (using glibc's backtrace functions in the preloadable tracing 
malloc implementation).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]