unaligned data access - Ultrix 3.0 (RISC)

Chris Cordrey chris at winsrf.dec.com
Fri Jul 21 06:00:35 AEST 1989



In article <861 at hadron.UUCP>, klr at hadron.UUCP (Kurt L. Reisler) writes:
> OK, this is a new to me.  Have been moving a variety of programs from an
> Ultrix 2.3 environment on a VS2000 (using X11.3) to a DS3100 and Ultrix
> 3.0 (and a mix of DECWindows and X 11.3) and I am coming up with the
> following error messages when certain programs (which compile and
> otherwise run flawlessly):
> 
> "Fixed up unaligned data access for pid XXXXXXX (proc_name) at pc 0xNNNNNN"
> 
> These message come out on stderr at sporatic intervals when programs
> such as dtree are run.  The program run fine otherwise.
> 
> Any suggestions as to what is going on, and what might be able to be
> done to eliminate the problem, other than diverting stderr to /dev/null.


see nac(1) for more info on how to shut off the messages.
Those "annoying" messages are coming from the Ultrix Kernel which has added
support on the DECstation to catch unaligned data accesses and fix them
dynamically for your program and let it continue running (an obvious
performance hit which you can fix by aligning the offending variables
in your source - the trick is finding them!)

VAXen are more forgiving in this area.  The DECstation 3100 assumes that
ints and pointers are aligned on longword (4byte) boundaries and that
shorts are aligned on halfword (2byte) boundries.  Here's an example of
unaligned data you can try on your 3100.

unaligned.c
--------------------
main()
{

short a = 1;
short b = 2;

printem(&a,&b);
}

printem(x,y)
int *x;
int *y;
{

printf("%d %d\n",*x,*y);
}

-----------------------

Hope this helps,
chris



More information about the Comp.unix.ultrix mailing list