Path: utzoo!attcan!uunet!cs.utexas.edu!sun-barr!lll-winken!unixhub!shelby!neon!rfischer From: rfischer@Neon.Stanford.EDU (Raymond C. Fischer) Newsgroups: comp.sys.mac.programmer Subject: Re: 'am I dead yet?', or, debugging Message-ID: <1990Oct24.200647.22234@Neon.Stanford.EDU> Date: 24 Oct 90 20:06:47 GMT References: <15998@csli.Stanford.EDU> Organization: Computer Science Department, Stanford University Lines: 23 In article <15998@csli.Stanford.EDU> ramaley@csli.Stanford.EDU (Alan Ramaley) writes: >The problem? Everytime I run it, it crashes at some point. And it >crashes completely, that is, the think C debugger breaks, I don't even >get a 'bus error' or anything like that. > >(2) Figure out where you are in the program using the debugger? Think C's debugger, while very good, probably won't do it for you. What I do is turn off the C debugger, let the program die, then use Macsbug to find out what's doing. In particular, use the commands ... HC (heap check) to see if your trashing the heap SC6 (stack crawl) to trace through the activation records, and SC7 (stack crawl) in case SC6 doesn't work. You should have compiled your program with the 'Macsbug Symbols' option checked so you can actual procedure names displayed. Taking a wild guess at your problem, I'd say that you're assuming some handle is in a place it no longer occupies. Keep in mind that the object of a handle can move. If you use a pointer to an object over many system calls, the object may move and you will overwrite the wrong thing. Ray Fischer rfischer@cs.stanford.edu