[PATCH][BZ 15089] Fixes malloc_trim always trims for large padding

Fernando J V da Silva fernandojvdasilva@gmail.com
Wed Nov 20 18:06:00 GMT 2013


Hi all!

I'm starting learning about glibc code and I've began trying to fix
the bug 15089. I've put some comments on Bugzilla and I wrote a patch
(attached) for fixing it, based on the solution proposed by Thiago
Ize' comment in Bugzilla as well
(https://sourceware.org/bugzilla/show_bug.cgi?id=15089).

That solution really fixes the problem, but the systrim() code still
mixes some signed and unsigned operations to calculate the size used
to call sbrk(), which may be dangerous (and in fact caused this bug).
I think the most correct solution would be to refactor this function
for only using unsigned variables but, to be honest, I haven't tried
it as I'm new on that (may be someone could give me some advices about
it?).

I would be glad if someone could have some time to comment it! :-)

Cheers,

Fernando J V da Silva
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fixes-BZ-15089-malloc_trim-always-trim-for-large-pad.patch
Type: text/x-patch
Size: 1234 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20131120/2f1a4513/attachment.bin>


More information about the Libc-alpha mailing list