| I have seen unaligned accesses when a caller and callee disagree
about the size of a parameter, for example, I saw this when calling
XTranslateCoordinates with pointers to shorts instead of pointers
to ints. However, the only parameter that seems suspicious in your
case is the context_id and I don't know enough to say whether that
could be the cause.
Jeff
|
| Jeff,
I don't understand...
Aren't pointers the same size regardless of whether they
point to ints or shorts ? Or am I being silly ?
I just ran a program on MIPS to print sizeof() for an int *,
and for a short *, and got 4 for both.
Dave
|
| The most common way of getting unaligned access errors is
Calling DwtGetNextSegment with a dirRtoL declared as a boolean. The routine
itself declares dirRtoL as a int *.
Having pointer dereferences like *(int *)p (where int could be short or
a struct tag * as well) and p is char *.
To find out where it is happening, use dbx. For instance:
Fixed up aligned access for pid 1110 (hpwm) at pc 0x44b820.
% dbx hpwm
[...]
(dbx) 0x44b810/10i
[XQueryPointer:176, 0x44b810] lw r14,96(sp)
[XQueryPointer:176, 0x44b814] lh r13,60(sp)
[XQueryPointer:176, 0x44b818] nop
[XQueryPointer:176, 0x44b81c] sw r13,0(r14)
[XQueryPointer:184, 0x44b820] lw r24,100(sp)
[XQueryPointer:184, 0x44b824] lh r15,62(sp)
[XQueryPointer:184, 0x44b828] nop
[XQueryPointer:184, 0x44b82c] sw r15,0(r24)
[XQueryPointer:192, 0x44b830] lw r8,104(sp)
[XQueryPointer:192, 0x44b834] lhu r25,64(sp)
So obviously hpwm has a problem calling XQueryPointer.
|
| Ok, I did that to track down the source of the problem originally,
and the subroutine I mentioned in .0 is what I arrived at.
Here's my version of the dbx dump, but I'm still unclear on whether
it's MY fault or not, as I'm not passing any strange arguments:
[DwtIdb__DB_GetDataEntry:198, 0x48b700] addiu r17,r17,16
[DwtIdb__DB_GetDataEntry:189, 0x48b704] ori r21,r21,0x88ae
[DwtIdb__DB_GetDataEntry:199, 0x48b708] beq r8,r21,0x48b748
[DwtIdb__DB_GetDataEntry:199, 0x48b70c] nop
[DwtIdb__DB_GetDataEntry:202, 0x48b710] lui r4,0x1002
[DwtIdb__DB_GetDataEntry:202, 0x48b714] lui r5,0x1002
[DwtIdb__DB_GetDataEntry:202, 0x48b718] li r9,26
[DwtIdb__DB_GetDataEntry:202, 0x48b71c] sw r9,16(sp)
[DwtIdb__DB_GetDataEntry:202, 0x48b720] addiu r5,r5,21328
[DwtIdb__DB_GetDataEntry:202, 0x48b724] addiu r4,r4,21304
Dave
|