Re: [PATCH]: Fix SIGBUS in JPEG handling on RISC



On Sat, 2007-11-03 at 15:50 -0700, David Miller wrote:
> From: Mathias Hasselmann <mathias openismus com>
> Date: Sat, 03 Nov 2007 09:12:19 +0100
> 
> > <offtopic>
> > I didn't write that code, but I'd consider it a philosophical question,
> > if that code or your CPU architecture is "buggy"... ;-)
> > </offtopic>
> 
> Whether CPU architectures should trap on unaligned loads and
> stores is indeed an interesting philosophical discussion.
> 
> But the C language is pretty clear on this case, in that pointer
> addresses should meet the necessary alignment for the given type
> behind that pointer.
> 
> So in a C language sense, the code is in fact buggy.
> 
> Alternatively, we can say that GTK+ knows better and simply
> block out such dumb platforms at the top-level configure :-)

Plus you don't want to trap.... it's going to be slow and might
even fill up the user's logs. (This used to be a problem on Alpha Linux
long a

Grep for '<< 8' in the gdkpixbuf sources and you'll find a small 
fraction of the other places where we go through effort avoid unaligned
access.

- Owen

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]