Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: adrian@expersoft.com (Adrian Wenden)
Subject: unaligned access
Date: 1995/05/20	[thread overview]
Message-ID: <3plnvd$gks@chomolangma.expersoft.com> (raw)

Can anyone help?

I am running OSF 3.0 on an Alpha 400 and compiling using the native 5.0 C++ 
compiler.

The application:

One process creates an object (A). One of A's data members is a pointer to 
another object, B. Object A is then streamed to another process. The
receiving process performs some operations on Object A, obviously ignoring
the Object B pointer, and sends Object A back to the sending process.

When the application used to run on a 32-bit architecture, we cast Object
B's pointer to an unsigned long and used the network functions htonl to
convert the byte ordering before streaming, and ntohl on the receiving side
to alter the byte ordering back to the machine format. All worked fine, 
until we tried to port it to a 64-bit architecture.

The problem:

What happens now is that the htonl function only reads the first 4 bytes, 
and therefore corrupts Object B's 8 byte pointer value, making it useless
when Object A is returned to us. We then tried using a64l, and l64a functions
to convert the 64-bit address into a base64 string, and stream the string
instead of the unsigned representation. As far as the contents of Object 
A is concerned it is reconstructed correctly when it is returned from the
the remote process, however when we attempt to use the object we get 
'Unaligned Access pid=<pid no> = <exe name> va=332e31386bde pc = 120179b9c
ra = 120179b78 type = ldq. 

Help:

Has anyone had either, any experience of streaming 64-bit numbers across 
the network or come across an unaligned access message, and can explain to
me how I can determine what has become unaligned and how I could correct it?

Many thanks

Adrian Wenden



adrian@expersoft.com
 
Expersoft Corporation
San Diego, CA

(619) 546 4100 x45



             reply	other threads:[~1995-05-20  4:00 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-05-20  4:00 Adrian Wenden [this message]
1995-05-22  4:00 ` unaligned access Eric Osborne
1995-05-24  4:00 ` Vepa V Sirish
1995-05-25  4:00 ` John Wood
  -- strict thread matches above, loose matches on Subject: below --
2003-03-06  6:27 Unaligned access Emmanuel STAPF [ISE]
2000-03-31  5:00 Kraisit Vittinanon
2000-04-04  4:00 ` Oisin McGuinness
1998-03-31  5:00 Allen M. Cohen
1998-04-01  5:00 ` Joe Mario
1996-11-15  5:00 unaligned access gautam
1996-11-16  5:00 ` Dirk Grunwald
1996-11-20  5:00 ` Jeff Denham
1996-11-22  5:00   ` Curt Smith
1996-11-21  5:00 ` Anthony Berent
1994-02-05 21:21 Stefan Monnier
1994-02-06  9:39 ` Jarkko Hietaniemi
1993-11-30 22:25 Roland Schemers
1993-11-30 23:25 ` Matt Thomas
1993-12-01 12:06 ` Burkhard Neidecker-Lutz
1993-12-07  1:27 ` Jim Hurst
1993-02-23 15:55 Unaligned access Byron Jennings
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox