From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,5bcae0baee38d312 X-Google-Attributes: gidfee84,public From: c632692@csdeca.cs.missouri.edu (Vepa V Sirish) Subject: Re: unaligned access Date: 1995/05/24 Message-ID: <3q0173$j09@news.missouri.edu>#1/1 X-Deja-AN: 103239695 distribution: usa references: <3plnvd$gks@chomolangma.expersoft.com> organization: University of Missouri - Columbia newsgroups: comp.unix.osf.osf1 Adrian Wenden (adrian@expersoft.com) wrote: : Can anyone help? : I am running OSF 3.0 on an Alpha 400 and compiling using the native 5.0 C++ : compiler. : 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= = va=332e31386bde pc = 120179b9c : ra = 120179b78 type = ldq. Hello Adrian, I can tell u what i do when I get the unaligned access messages. When u declare the variables in the main(), take care in declaring the variables of the largest size first, and then declare the smaller ones laters. It might help to add a dummy variable like this main() double dummy ; /* force declarations of subsequent vars along the word boundary */ then delclare the structures, the character buffers and then pointers provided the structures are greater than 8 bytes and so are the character buffers, and finally declare the integers and last the characters (they are 1 byte) .; I have observed that when I do this,the mesg disappears. Also u will be surprised in the manner in which the structure members are declared. Declare the larger ones first and then the smaller ones for example struct XXX_fo { long x ; /* 8 bytes */ char *str ; /* 8 bytes */ int some_no ; /*4 bytes */ char c ; /* 1 byte */ } ; Do try rearranging the order in which the classes/structures are defineed and I do feel there would be a drastic improvement. I work on a DEC Alpha machine too and have observed the same problems sirish the message is generated because the alpha 64 accesses data structures along 64 bit word boudaries and is very particular about that . : 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 -- ******************************************************************************* Vepa V Sirish ,1205 University Av.,338 ,Columbia MO 65201,Ph (R) (314)-499-0855 316 A&S Bldg, U of Missouri, Columbia MO 65211,Ph (O) (314)-882-7534 E-mail : sirish@csdeca.cs.missouri.edu, c632692@mizzou1.missouri.edu *******************************************************************************