[Spread-users] unaligned int access on sparc solaris

John Schultz jschultz at spreadconcepts.com
Mon Aug 20 11:09:08 EDT 2007

Yes, the second cast is a bug that was reported previously.  It should 
also be casting to *(const stduint8*).


John Schultz
Spread Concepts
Phn: 443 838 2200

On Mon, 20 Aug 2007 drago.krznaric at se.transport.bombardier.com wrote:

> Hi all,
> I just downloaded spread-4.0.0 and compiled it for sun sparc solaris.
> Unfortunately, I got a bus error when starting spread daemon, caused by
> the following
> macro in stdutil.c:
> #  define stdhcode_sfh_get16bits(d) ( ((stduint32) *((const stduint8 *)(d)
> + 1) << 8) | *(const stduint32 *)(d) )
> It is the  '  *(const stduint32 *)(d)  ' that sparc doesn't like when d
> doesn't point to an aligned integer.
> For me it looks as if one tries to flip the bytes in a short (big endian
> to little endian), in which case the following
> should do the same thing but without the bus error:
> #  define stdhcode_sfh_get16bits(d) ( ((stduint32) *((const stduint8 *)(d)
> + 1) << 8) |  (stduint32)*(const stduint8 *)(d)  )
> Has anybody else done a similar change?
> /Drago
> _______________________________________________________________________________________________________________
> This e-mail communication (and any attachment/s) may contain confidential
> or privileged information and is intended only for the individual(s) or
> entity named above and to others who have been specifically authorized to
> receive it. If you are not the intended recipient, please do not read,
> copy, use or disclose the contents of this communication to others. Please
> notify the sender that you have received this e-mail in error by reply
> e-mail, and delete the e-mail subsequently. Please note that in order to
> protect the security of our information systems an AntiSPAM solution is in
> use and will browse through incoming emails.
> Thank you.
> _________________________________________________________________________________________________________________
> Ce message (ainsi que le(s) fichier/s), transmis par courriel, peut
> contenir des renseignements confidentiels ou protégés et est destiné à
> l?usage exclusif du destinataire ci-dessus. Toute autre personne est par
> les présentes avisée qu?il est strictement interdit de le diffuser, le
> distribuer ou le reproduire. Si vous l?avez reçu par inadvertance,
> veuillez nous en aviser et détruire ce message. Veuillez prendre note
> qu'une solution antipollupostage (AntiSPAM) est utilisée afin d'assurer la
> sécurité de nos systems d'information et qu'elle furètera les courriels
> entrant.
> Merci.
> _________________________________________________________________________________________________________________

More information about the Spread-users mailing list