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: PING: PATCH: [BZ #14562] Properly handle fencepost with MALLOC_ALIGN_MASK


On Mon, Sep 24, 2012 at 5:53 AM, Siddhesh Poyarekar <siddhesh@redhat.com> wrote:
> On Wed, 12 Sep 2012 08:37:56 -0700, H.J. wrote:
>> >
>> >         [BZ #14562]
>> >         * malloc/arena.c ): Properly get fencepost and
>> > adjust new chunk size with MALLOC_ALIGN_MASK.
>
> Have you figured out how the misalignment happens?  It looks as though
> heap->size should be aligned to page mask, and any grow/shrink requests
> (coming from int_malloc) should also pass correctly aligned parameters,
> so any such misalignment should probably be a bug elsewhere?
>

There is no misalignment for fencepost.  fencepost has been aligned to
MALLOC_ALIGNMENT.  The issue is

chunk_at_offset(prev_heap, prev_heap->size - (MINSIZE-2*SIZE_SZ));

may not point to fencepost if it isn't aligned to MALLOC_ALIGNMENT.
My patch makes sure that heap_trim gets fencepost aligned to
MALLOC_ALIGNMENT.

-- 
H.J.


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