NetBSD

ID #1097

Nasty message from the kernel saying something about unaligned accesses

Nothing is wrong with the machine. This happens when programs illegally cast types or make various other type-unsafe assumptions. Unlike the x86 and vax, risc processors require data items to be aligned. The compilers do this automatically, but some programs are so badly written that they override the compiler's choices and force the compiler to accept type-unsafe constructs.

The NetBSD kernel will fix these up on the fly, though it may slow your application down. To fix each unaligned access fault requires:

  1. Overhead of taking an unaligned access fault.
  2. Overhead of fixup.
  3. Additional overhead for (2) because access must be across a protection boundary.

Using sysctl(8), the action can be tuned to one of:

  1. Silently fixup the unaligned access.
  2. Print out a message and fixup the unaligned access.
  3. Silently send the process a SIGBUS.
  4. Print out a message and send the process a SIGBUS.

The default action is equivalent to:

	<?php
#
?>
<?php
sysctl
-w machdep.unaligned_print=1
?>

<?php
#
?>
<?php
sysctl
-w machdep.unaligned_fix=1
?>

<?php
#
?>
<?php
sysctl
-w machdep.unaligned_sigbus=0
?>

An unaligned access performed by the kernel will always cause a panic.

Tags: kernel, NetBSD/alpha, sysctl

Related entries:

Last update: 2009-08-03 18:17
AuthorLuke Francis
Revision: 1.0

Digg it! Print this record Send FAQ to a friend Show this as PDF file
Propose a translation for Propose a translation for
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry