Xref: utzoo comp.unix.ultrix:6322 comp.sys.mips:1396 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!rpi!uupsi!sunic!zyx!arndt From: arndt@zyx.ZYX.SE (Arndt Jonasson) Newsgroups: comp.unix.ultrix,comp.sys.mips Subject: How to trap unaligned accesses on Ultrix/MIPS? Message-ID: <1991Feb22.154608.27095@ZYX.SE> Date: 22 Feb 91 15:46:08 GMT Sender: arndt@ZYX.SE (Arndt Jonasson) Organization: ZYX AB, Stockholm, Sweden Lines: 29 Environment: DECStation (MIPS), Ultrix 4.1. When a process accesses a word of memory on a non-aligned address, the kernel fixes up the access, and optionally prints a message. This message can be turned off with the 'uac' command. For debugging purposes, it would be much more convenient if the kernel didn't fix up the access, and sent a signal to the process instead (e.g., "bus error" or "segmentation violation"). Is it possible to make this happen? /* When this program runs, it should get a signal on at least one of the marked lines. */ main () { char *kaka = "vanilj"; int *ip; ip = (int *) kaka; *ip = 1; /* XXX */ ip = (int *) (kaka+1); *ip = 2; /* XXX */ } -- Arndt Jonasson, ZYX AB, Styrmansgatan 6, 114 54 Stockholm, Sweden email address: arndt@zyx.SE or !mcsun!sunic!zyx!arndt Brought to you by Super Global Mega Corp .com