Path: utzoo!attcan!uunet!bu.edu!dartvax!chocorua!kurash From: kurash@chocorua.dartmouth.edu (Mark Valence) Newsgroups: comp.sys.mac.programmer Subject: Re: "Out of memory" Summary: corrupting heap info Keywords: memory trashing crash boom bang ouch Message-ID: <24407@dartvax.Dartmouth.EDU> Date: 19 Sep 90 16:22:43 GMT References: <120394@linus.mitre.org> <10287@goofy.Apple.COM> Sender: news@dartvax.Dartmouth.EDU Reply-To: kurash@chocorua (Mark Valence) Organization: Dartmouth College Lines: 32 In article <10287@goofy.Apple.COM> stevec@Apple.COM (Steve Christensen) writes: >In article <120394@linus.mitre.org> laf@mbunix.mitre.org (Lee Fyock) writes: >>What causes the multifinder message "The application XXX >>unexpectedly quit (out of memory)"? I would think that a >>memory request (NewPtr or NewHandle) would cause it, but >>shouldn't they just return null, with the appropriate MemErr? > >This should only happen if somewhere within the OS or ToolBox there's a >request for memory (which it can't get), and it can't back out gracefully. >I can't remember if this could happen when a new segment needs to be loaded >(or if that would return a segment loader error), but that's the kind of case >where it could happen. In that case, one routine tries to call another >routine in another segment, the segment can't be loaded, and the app can't >go anywhere from there so it dies. > >If the app itself calls NewPtr or NewHandle, it would check for a nil pointer >or handle, or MemErr, so it wouldn't suffer this kind of death. Application XXX may not be the problem. Since there is no memory protection (that topic has been beaten to death already), any other program can write to application XXX's memory (accidentally, of course). Maybe you have an evil INIT, or one of your other apps running under MultiFinder is giving you trouble. Cut to the point! The evil program might trash a master pointer block, or some other important heap information, which would make XXX think that it ran out of memory. Some ROM routines like to have a FEW bytes of heap space when they run, but MacEvilApp has made it look like you have no space (or even negative space). Ooops. Of course application XXX and MacEvilApp might be one in the same. Mark.