This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Deprecate hook variables, __default_morecore, <mcheck.h>
On Wed, Nov 16, 2016 at 1:36 AM, Joseph Myers <joseph@codesourcery.com> wrote:
> On Tue, 15 Nov 2016, Florian Weimer wrote:
>
>> > I don't consider valgrind suitable for replacing the uses of mtrace in the
>> > glibc testsuite (or other similar uses elsewhere for lightweight checking
>> > for leaks).
>>
>> I completely agree.
>>
>> The above is for the NEWS file, for external use. For internal use, we still
>> need a solution. (I have an mtrace-compatible interposition-based tracer
>> almost finished, but it may not make the cut for the next release, and it may
>> be superseded by DJ's work anyway.) I think we can run internal deprecation
>> at a different pace than external deprecation.
>
> 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.
It is a useful feature to use on constrained systems to do basic
allocation tracing. The main deficiency it has is it is not
thread-safe, which makes it rather useless for many modern
applications. In an ideal world glibc malloc would support a wider
range of tracing and profiling features similar to jemalloc/tcmalloc,
e.g. thread-safe allocation tracing, pprof.