[PATCH v5 1/8] Move malloc hooks into a compat DSO

Siddhesh Poyarekar siddhesh@sourceware.org
Tue Jul 6 13:00:01 GMT 2021


On 7/6/21 3:47 PM, Florian Weimer via Libc-alpha wrote:
> * Siddhesh Poyarekar:
> 
>> Remove all malloc hook uses from core malloc functions and move it
>> into a new library libc_malloc_debug.so.  With this, the hooks now no
>> longer have any effect on the core library.
> 
> There are still a few references to libmalloc_compathooks.

Fixed locally.

>> diff --git a/elf/Makefile b/elf/Makefile
>> index 698a6ab985..b432e78d39 100644
>> --- a/elf/Makefile
>> +++ b/elf/Makefile
>> @@ -156,7 +156,7 @@ $(inst_auditdir)/sotruss-lib.so: $(objpfx)sotruss-lib.so $(+force)
> 
>> @@ -1561,7 +1558,8 @@ $(objpfx)tst-nodelete-dlclose.out: $(objpfx)tst-nodelete-dlclose-dso.so \
>>   				   $(objpfx)tst-nodelete-dlclose-plugin.so
>>   
>>   tst-env-setuid-ENV = MALLOC_CHECK_=2 MALLOC_MMAP_THRESHOLD_=4096 \
>> -		     LD_HWCAP_MASK=0x1
>> +		     LD_HWCAP_MASK=0x1 \
>> +		     LD_PRELOAD=$(common-objpfx)/malloc/libc_malloc_debug.so
> 
> I don't think this test needs the debugging allocator, it uses getenv to
> see if the environment has been scrubbed.

You're right, it doesn't.  I'll remove that.

> In general, it looks like it's time to add support for mtrace tests to
> the setsuite (that is, tests-mtrace like tests-time64).

... or tests-mcheck/tests-malloc-check.  Would you be OK with having the 
test driver call mtrace() at all times?  Only the tests in tests-mtrace 
(which for starters we could add all tests in malloc to) will actually 
have any impact.

Thanks,
Siddhesh


More information about the Libc-alpha mailing list