This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] malloc: Fix for infinite loop in memalign/posix_memalign.
- From: Will Newton <will dot newton at linaro dot org>
- To: "Carlos O'Donell" <carlos at redhat dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>, Patch Tracking <patches at linaro dot org>
- Date: Wed, 30 Oct 2013 14:50:58 -0700
- Subject: Re: [PATCH] malloc: Fix for infinite loop in memalign/posix_memalign.
- Authentication-results: sourceware.org; auth=none
- References: <52569CED dot 3060700 at linaro dot org> <52715603 dot 9060106 at redhat dot com>
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