Bug#642762: xulrunner-6.0: console flooded with unaligned access messages on ia64 (IA-64/IPF/Itanium) platform

Émeric Maschino emeric.maschino at gmail.com
Wed Oct 5 15:17:56 UTC 2011


2011/10/5 Mike Hommey <mh at glandium.org>:
> On Wed, Oct 05, 2011 at 10:50:56AM +0200,
>
> The problem is not the alignment of m2, the problem is the alignment of
> the whole struct, which has a requirement of 32-bits. Which means a
> struct nsID can end up at 0x0, 0x4, 0x8, or 0xc. When it's at 0x4 or
> 0xc, it can't be casted to a 64-bits word, because that's not 64-bits
> aligned. There are two solutions: make sure struct nsIDs are 64-bits
> aligned, or change the Equals function to use 2 32 bits words
> comparisons.

Sorry, I thought that padding nsID like I did in my previous comment
was the way to make it 64-bit aligned :-(
How then can it be modified to make it 64-bit aligned?

Alternatively, if changing Equals to use 32-bit words comparisons,
will it become:

inline PRBool Equals(const nsID& other) const {
   return
     ((PRUint32*) &m0)[0] == ((PRUint32*) &other.m0)[0] &&
     ((PRUint32*) &m1)[0] == ((PRUint32*) &other.m1)[0] &&
     ((PRUint32*) &m3)[0] == ((PRUint32*) &other.m3)[0] &&
     ((PRUint32*) &m3)[1] == ((PRUint32*) &other.m3)[1];
 }

     Emeric





More information about the pkg-mozilla-maintainers mailing list