PATCH: Malloc fails if MALLOC_ALIGNMENT > 2 * SIZE_SZ
Daniel Jacobowitz
drow@false.org
Sat Aug 20 18:21:00 GMT 2011
On Sat, Aug 20, 2011 at 12:53 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> And as a reminder for those who didn't follow the previous thread, in the
>> existing state arbitrary code mallocing datastructures containing long
>> double may be *quietly* broken (AltiVec loads and stores used at runtime,
>> expecting 16-byte alignment, on data that is only 8-byte aligned - these
>> don't trap, the documented semantics are to quietly ignore the low bits of
>> the address). As I understand, the Emacs breakage is it least immediately
>> obviously visible rather than quiet.
>
> That is probably so (though I don't think there's any real guarantee that
> we can expect an immediate crash on malloc_set_state). But, in the time
> scales of ABI changes, -mlong-double-128 was a recent addition and things
> using that long double type on powerpc32 are neither very common at all,
> nor did they ever work reliably in the past. So both issues affect few
> programs in practice. The one is a bad situation that has existed for a
> short time for using a new feature, while the other would be a breakage of
> an existing ABI that always worked before.
I think I explicitly called this out back in 2007, but if not, one of
the victims of this breakage is GDB. Obviously the most important
binary on any system :-)
(Mental image: rock-paper-scissors. emacs running gdb debugging emacs...)
I think it's a serious shame that we're breaking conforming code to
preserve an ABI used pretty much only by emacs. Emacs's needs are
pretty specialized; most applications want a different sort of storage
for precached state.
--
Thanks,
Daniel
More information about the Libc-alpha
mailing list