From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,122fe49294f74514,start X-Google-Attributes: gid1164f8,public X-Google-Thread: 1094ba,122fe49294f74514,start X-Google-Attributes: gid1094ba,public X-Google-Thread: fee84,122fe49294f74514,start X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1993-08-27 07:04:54 PST Xref: gmd.de comp.unix.osf.osf1:920 comp.sys.dec:9742 comp.lang.fortran:7555 Newsgroups: comp.unix.osf.osf1,comp.sys.dec,comp.lang.fortran Path: gmd.de!xlink.net!howland.reston.ans.net!usc!cs.utexas.edu!utnut!helios.physics.utoronto.ca!sysmark From: sysmark@helios.physics.utoronto.ca (Mark Bartelt) Subject: How can I cause unaligned access to generate SIGBUS under DEC OSF/1? Message-ID: Sender: news@helios.physics.utoronto.ca (News Administrator) Reply-To: mark@cita.toronto.edu Organization: University of Toronto Physics/Astronomy/CITA Date: Fri, 27 Aug 1993 13:59:13 GMT Someone in our group is trying to debug a rather ugly chunk of Fortran code on our AXPs, and is getting a number of runtime "Unaligned access" messages. I know how to use the "uac" command to turn the message off, but since I suspect that the existence of the unaligned access probably means that the code is broken, I'd like to be able to trap them. Specifically, I expect to find errors of the following sort: common /spam/ x,y,z real*4 x,y,z call foo(y) [...] subroutine foo(q) real*8 q [...] It's surprising how much of this sort of cruft one finds, partly because on a VAX, with real*4 and real*8 having same-size exponents, code such as this would seemingly work (since there'd be only some small error down in the low-order bits of the mantissa). But of course, with IEEE floating point, one tends to get totally bogus results with this kind of error. Anyway, looking through , I find struct proc { [...] int p_uac; /* unaligned access control flags */ [...] }; [...] /* p_uac codes */ #define UAC_NOPRINT 0x00000001 /* Don't report unaligned fixups */ #define UAC_NOFIX 0x00000002 /* Don't fix unaligned errors */ #define UAC_SIGBUS 0x00000004 /* Notify unaligned trap by SIGBUS */ The question is, how can I set the UAC_SIGBUS bit in p_uac? If I could, then I can ask dbx to catch SIGBUS, and it should be relatively easy to track down the bug(s). I RedTFM, but didn't find anything relevant. Is there an undocumented system call which permits one to twiddle the bits in the the proc struct's p_uac? As usual, TIA. Mark Bartelt 416/978-5619 Canadian Institute for mark@cita.toronto.edu Theoretical Astrophysics mark@cita.utoronto.ca "Clothes not busy being worn are busy drying." - Dylan, on laundry day [ singing "It's all right, ma (I'm only bleaching)" ]