Path: utzoo!attcan!uunet!munnari.oz.au!uniwa!fennel.cc.uwa.oz.au!a_dent From: a_dent@fennel.cc.uwa.oz.au Newsgroups: comp.sys.mac.programmer Subject: Re: Program 'runs' in LSP, but crashes when app runs Message-ID: <1991Jan24.085452.2814@fennel.cc.uwa.oz.au> Date: 24 Jan 91 00:54:52 GMT References: <28060.279b01f2@kuhub.cc.ukans.edu> Organization: University of Western Australia Lines: 45 In article <28060.279b01f2@kuhub.cc.ukans.edu>, mlab2@kuhub.cc.ukans.edu writes: > Has anyone else had one of those bugs with LSP where it RUNs under the > compiler, but when COMPILED, the app crashes? > > Can you characterize those bugs? It would be nice to have a guide explaining > likely errors when xx crash occurs. > > Right now, I have an address error when the standalone runs - no prob under > LSP. (Maybe I ought to ship it AS source :) ). The following is a repost of part of a recent posting of mine describing woes with CLists: 2) If you are having trouble with random crashes traversing lists, particularly a program which works in the THINK environment but crashes in an application, then may have bad contents in a list. For some reason, the THINK environment seems a lot more rugged and able to ignore nonsense handles. I wrote the following procedure and edited the CList source, to trap any such occurrences. The Symantec licensing prohibits me publishing the modified source, but basically you put lines like the following, inside the Append, Remove, etc.. procedures: checkHandle(theObject, ' called from Append '); { include this procedure at the top of the implementation section of CList } procedure checkHandle (h: univ Handle; msg: Str255); var handleSize: Size; strHandle: Str255; begin handleSize := GetHandleSize(Handle(h)); if handleSize = 0 then begin NumToString(Ord4(h), strHandle); debugStr(concat('Bad handle in ', msg, ' = ', strHandle)); end; end; { checkHandle } > > john calhoun Andy Dent A.D. Software phone 09 249 2719 Mac & VAX programmer 94 Bermuda Dve, Ballajura a_dent@fennel.cc.uwa.oz Western Australia 6066 a_dent@fennel.cc.uwa.oz.AU (international)