[PATCH] malloc: Deprecate hook variables, __default_morecore, <mcheck.h>
Florian Weimer
fweimer@redhat.com
Tue Nov 15 15:56:00 GMT 2016
On 11/15/2016 04:39 PM, Joseph Myers wrote:
> On Tue, 15 Nov 2016, Florian Weimer wrote:
>
>> In my opinion, the larger ecosystem already provides suitable replacements.
>>
>> * <mcheck.h> and all malloc hook functions are now deprecated. Future
>> implementations of the mcheck- and mtrace-related functions will not
>> have any effect, and glibc will stop calling the hook functions from
>> its malloc implementation. Instead of mcheck and mtrace, developers
>> should consider using valgrind. As a replacement for the hook
>> functions, developers can interpose their own malloc implementation.
>
> 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.
> I don't know enough about the functionality GDB expects from linking with
> -lmcheck by default in development to know whether other malloc
> improvements would provide similar checking by default or whether that
> would also need GDB to provide its own malloc (again, I think valgrind is
> vastly too heavyweight for using by default in GDB development).
I wasn't aware that GDB developers are using this functionality. I'll
ask them how critical it is to their needs. But I expect that there
will be no glibc release which neither provides mcheck, nor provides an
alternative.
Thanks,
Florian
More information about the Libc-alpha
mailing list