This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/12495] Malloc fails if MALLOC_ALIGNMENT > 2 * SIZE_SZ
- From: "hjl.tools at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 2 Mar 2011 02:22:00 +0000
- Subject: [Bug libc/12495] Malloc fails if MALLOC_ALIGNMENT > 2 * SIZE_SZ
- Auto-submitted: auto-generated
- References: <bug-12495-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=12495
--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> 2011-03-02 02:21:48 UTC ---
The problem is
/* check that one of the above allocation paths succeeded */
if ((unsigned long)(size) >= (unsigned long)(nb + MINSIZE)) {
remainder_size = size - nb;
remainder = chunk_at_offset(p, nb);
av->top = remainder;
set_head(p, nb | PREV_INUSE | (av != &main_arena ? NON_MAIN_ARENA : 0));
set_head(remainder, remainder_size | PREV_INUSE);
check_malloced_chunk(av, p, nb);
return chunk2mem(p);
}
We need to properly handle alignment here.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.