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: Fix for infinite loop in memalign/posix_memalign.


On 30 October 2013 11:54, Carlos O'Donell <carlos@redhat.com> wrote:
> On 10/10/2013 08:26 AM, Will Newton wrote:
>> A very large alignment argument passed to mealign/posix_memalign
>> causes _int_memalign to enter an infinite loop. Limit the maximum
>> alignment value to the maximum representable power of two to
>> prevent this from happening.
>
> OK to checkin.

Thanks, applied.

> This looks good to me, adds tests with comments, and detects an
> invalid alignment which is required given the linux kernel man pages
> documentation.
>
> We still lack updated manual info for memalign and posix_memalign
> where we should be covering what is returned as valid errno values
> for these functions e.g. EINVAL and ENOMEM (that is to say that
> manual/memory.texi doesn't say that memalign and posix_memalign
> return any useful errors).

I've added that to my todo list.

-- 
Will Newton
Toolchain Working Group, Linaro


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