[Ffmpeg-devel] random crashes decoding MP3s

Dave Dodge dododge
Tue Apr 4 06:30:16 CEST 2006

On Mon, Apr 03, 2006 at 02:00:41PM -0400, Rich Felker wrote:
> The SVR4 ABI (which is idiotic but everyone uses it) for x86 aligns
> double at 32 bits, not 64 bits. This results in bad performance on
> modern systems but changing it will break binary-compatibility with
> anything using structs containing doubles.

In a way it's even worse than that.  If you use gcc's __alignof__
extension you actually get different results for a double object
depending on context (x86, gcc 3.4.2):

  struct { double x; }y;
  double z;

  __alignof__(y.x) = 4
  __alignof__(z) = 8
  __alignof__(double) = 8

These results contradict the gcc manual, which implies that
__alignof__(lvalue) is supposed to be based on the type of lvalue
rather than the object itself.  However if they changed the
implementation to actually work that way it might make things even
more confusing.

Presumably on architectures with stricter alignment rules (e.g. SPARC)
things are at least consistent.

                                                  -Dave Dodge

More information about the ffmpeg-devel mailing list