empty
/ documentation / unix & linux environment /

Debugging Notes

Unaligned access on Alpha

These problems are recognized by kernel messages which look something like this:

... <program>(<process-id>): unaligned trap at <addr1>: <addr2> ...

There is a small utility available called unalign.c which runs the offending program in GDB and breaks execution when the unaligned access occurred. However, if this doesn't work then you can attempt to manually find the point where the unaligned access occurred:

Alternatively, you can use GDB's disassemble command combined with its /m switch:

  disassemble /m 0x<addr1>
This will output assembly code interspersed with source code of the program. It will output all code of the function where the unaligned access occurred, so you need check which instruction/statement corresponds to addr1.

More information on unaligned access can be found in Gentoo's Porting Guide.