Next: , Previous: , Up: Problems running   [Contents][Index]

8.3.5 ‘Unaligned access’ warnings

On some platforms you may encounter messages like the following written to the console and/or various system log files (e.g., /var/log/messages):

myprog(25044): unaligned access to 0x6000000000001022,


Unaligned access pid=7890104 <myprog> va=0x140004221 pc=0x1200012b4
ra=0x1200012a4 inst=0xb449fff8

What’s happening is that some CPUs require n-byte-wide data to be aligned on an n-byte boundary. For example, a 64-bit datatype can be accessed properly only from memory locations whose address is a multiple of 64 bits (8 bytes). On some platforms, misaligned accesses abnormally terminate the program, typically with a SIGBUS signal. On other platforms, misaligned accesses interrupt the operating system. The operating system fixes the access by splitting it into multiple aligned accesses plus some bit masking and shifting and then notifying the user and/or system administrator that a fixup occurred.

coNCePTuaL’s configure script automatically determines what data alignments are allowed by the architecture but it has no way to determine if fixups occurred as these are transparent to programs. The result is annoying “unaligned access” messages such as those quoted above. One solution is to use the --with-alignment option to configure to specify explicitly the minimum data alignment that coNCePTuaL should be permitted to use. Alternatively, some operating systems provide a mechanism to cause misaligned accesses to result in a SIGBUS signal instead of a fixup and notification message. On Linux/IA-64 this is achieved with the command prctl --unaligned=signal. On OSF1/Alpha the equivalent command is uac p sigbus. Be sure to rerun configure after issuing those commands to make it reexamine the set of valid data alignments.

Next: , Previous: , Up: Problems running   [Contents][Index]

Scott Pakin,