Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!dewey.soe.berkeley.edu!oster From: oster@dewey.soe.berkeley.edu (David Phillip Oster) Newsgroups: comp.sys.mac.programmer Subject: Re: Debugger Info wanted Message-ID: <32962@ucbvax.BERKELEY.EDU> Date: 3 Dec 89 03:27:46 GMT References: <1262@castle.ed.ac.uk> Sender: usenet@ucbvax.BERKELEY.EDU Reply-To: oster@dewey.soe.berkeley.edu.UUCP (David Phillip Oster) Organization: School of Education, UC-Berkeley Lines: 30 The most common cause of complete lockup of the Macintosh by buggy programs is: Copying arbitrary data into low memory, for example: char *src, dest; src = "\pGuaranteed to Clobber the Interrupt Vector Table."; dest = NIL; BlockMove(src, dest, (long) (unsigned char) src[0]); You can check for this by setting MacsBug to checksum a location in low memory after every instruction. You might want to set Debugger() statements throughout your program to home in on the suspect code. (Put a debug statement in the middle, run it. If it crashes before it hits the middle, you know the problem is in the first half...) There is currently a market niche for a product that to reprogram the MMU on those macs that have one to let the programmer declare a block of addresses as READ-ONLY, and generate an interrupt to the debugger when an instruction trys to store there. Since most Mac programs store data in handles and in movable code segments (which are also handles) such a tool would not be ideal (It would get in the way of normal heap motion.), but it would at least solve the low-memory clobber problem. --- According to the Constitution, the Constitution is unconstitutional: --- David Phillip Oster --U.S.Constitution I.10.1: "No State shall Arpa: oster@dewey.soe.berkeley.edu --enter into any treaty, alliance, or Uucp: {uwvax,decvax}!ucbvax!oster%dewey.soe.berkeley.edu -- confederation..."