Path: utzoo!mnetor!uunet!iscuva!jimc From: jimc@iscuva.ISCS.COM (Jim Cathey) Newsgroups: comp.sys.mac Subject: Re: stack sniffer evils Message-ID: <1142@iscuva.ISCS.COM> Date: 4 Feb 88 16:58:47 GMT References: <363@moncsbruce.oz> Organization: ISC Systems Corporation, Spokane, WA Lines: 25 Keywords: mac programming, lightweight processes, SysError() In article <363@moncsbruce.oz> conybear@moncsbruce.oz (Roland Conybeare) writes: >The solution: > The ideal solution to this inappropriate bomb would be for Apple >to have provided some way of turning off the stack sniffer. The next best >thing would be to do it ourselves. > My current solution is to replace the SysError() trap with my >own version, which ignores 'stack in the heap' errors while passing other >errors on to the original trap handler. This means the stack sniffer still >detects 'stack in the heap' up to 60 times a second, but my SysError() trap >says the application managed to recover from the error. The stack sniffer is easily disabled by placing a zero in the global variable StkLowPt ($110-$113). The sniffer code then ignores the stack. When you're done, you should restore it to whatever it was so that the stack sniffer will start working again. I don't remember where this was documented, but it is a relatively well-known technique. +----------------+ ! II CCCCCC ! Jim Cathey ! II SSSSCC ! ISC Systems Corp. ! II CC ! TAF-C8; Spokane, WA 99220 ! IISSSS CC ! UUCP: uunet!iscuva!jimc ! II CCCCCC ! (509) 927-5757 +----------------+ "With excitement like this, who is needing enemas?"