[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

1804.0. "unaligned data access on PMAX (DECstation 3100)" by MARX::KELLEY () Tue Nov 28 1989 14:31

    When I run my DECWindows application on a DECstation 3100 (PMAX) I
    get the following message:
    
    **************************************************************************
    Fixed up unaligned data access for pid 9083 (nms_query_tcp) at pc 0x4fc874
    **************************************************************************
    
    I then went into dbx and the following is at the pc mentioned above
    
    (dbx) 0x4fc874/10i
    [store_int:95, 0x4fc874]      jr      r31      
    [store_int:95, 0x4fc878]      nop
    [_doscan, 0x4fc87c]   addiu   sp,sp,-368
    [_doscan, 0x4fc880]   sw      r20,48(sp)
    [_doscan:112, 0x4fc884]       lui     r20,0x1005
    [_doscan:104, 0x4fc888]       sw      r30,64(sp)
    [_doscan:104, 0x4fc88c]       sw      r23,60(sp)
    [_doscan:104, 0x4fc890]       sw      r19,44(sp)
    [_doscan:104, 0x4fc894]       sw      r16,32(sp)
    [_doscan:104, 0x4fc898]       move    r16,r4
    
    Does anyone have a clue on how to fix this. The store_int routine is not
    in my code. I believe its in the DECWindows stuff...
    
    HELP...
    Bruce
T.RTitleUserPersonal
Name
DateLines
1804.1Look at ULTRIX doc...FUEL::grahamif ya want home cookin, stay homeTue Nov 28 1989 17:0257
Re:.0

>Fixed up unaligned data access for pid 9083 (nms_query_tcp) at pc 0x4fc874
> Does anyone have a clue on how to fix this. The store_int routine is not
>in my code. I believe its in the DECWindows stuff...

RISC systems, unlike VAX, process word references to be "naturally aligned"..
short words (2 bytes) have an even byte boundary and long words (4 bytes)
are accessed on boundaries divisible by 4.  On a VAX, short and long words
can be accessed on any byte boundary.

The "fixed up..." messages that you see is a successful attempt by ULTRIX 
to fix up unaligned accesses in programs.  A failure to do so will cause
the processes to be terminated with a bus signal error.

Generally, it is a good thing to avoid unaligned accesses, because they
cause 'traps' in the ULTRIX kernel, which in turn affect overall system
performance.

UAC is the utility on ULTRIX to manage the "unaligned" access.

RISC                                                       uac(1)

NAME
     uac - Unaligned Access Message Control

SYNTAX
     uac s p value

DESCRIPTION
     The uac command controls printing of "Fixed up unaligned
     data access for pid nnn at pc 0xAddr" messages.  This com-
     mand is used to set or display the flag that controls print-
     ing of the message for the system, or for the parent process
     of the user, typically a shell.

OPTIONS
     The following options can be used with the uac command:

     s    Set/display the current setting of the flag for the
          system.

     p    Set/display current setting of the flag for the parent
          process.

VALUES
     If the value is present, the flag is set; otherwise, the
     current setting of flag is displayed.  The value can be
     either a zero (0) to turn the flag off, or a one (1) to turn
     the flag on.

RESTRICTIONS
     You must be superuser to set the system flag.

                                                                1
Kris...
1804.2Avoid them on VAXen as wellCRLMAX::jgJim Gettys, Cambridge Research LabTue Nov 28 1989 17:184
Unaligned references on VAXen slow them down too; unaligned data is always
a bad idea.  The cost on the VAX is not as large (microcode trap rather
than real trap), and you get silently penalized.
				- Jim
1804.3still need helpMARX::KELLEYWed Nov 29 1989 18:349
    How can I go about getting this fixed. Just turning off the display
    of the message with "uac s 0" is really unexceptable. It's just 
    hiding the problem.
    
    Can anyone give a solution to the REAL problem?
    
    Thanks much!
    Bruce
    
1804.4K & R....FUEL::grahamGimme what you can get back..Wed Nov 29 1989 22:4420
> How can I go about getting this fixed. Just turning off the display
>of the message with "uac s 0" is really unexceptable. It's just
> hiding the problem.

>Can anyone give a solution to the REAL problem?


It is very hard to understand *every* aspect of your problem if
nobody can see your code.

Assuredly, if you make all your user program's integers amd pointers
align on longword boundaries, and shorts on word boundaries, everything
will behave normally.  Take the Kernighan and Ritchie 'C' text, and look at 
the index on the following topics - "alignment, bit field", "alignment by
union", and "alignment restriction".

Sorry to disappoint you with the answers so far.

Kris..
1804.5Need more informationHANNAH::MESSENGERBob MessengerThu Nov 30 1989 13:2014
I think normally the C compiler will align things correctly.  You can get into
trouble when playing around with pointers and casting data to different types.

There was a data alignment problem in DECterm which was caused by DECterm
freeing data that it hadn't allocated (i.e. it passed an address in the middle
of a block of data instead of at the start of the block).  That's just one
example of how things can go wrong.

Since you've said that the problem seems to be in a DECwindows routine, could
you tell us more about what routine you are calling?  Maybe you need to be
more careful with the type and alignment of the data you are passing to the
routine.

				-- Bob