Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ginosko!uunet!mcsun!hp4nl!eutrc3!rcbaem From: rcbaem@eutrc3.urc.tue.nl (Ernst Mulder) Newsgroups: comp.sys.mac.programmer Subject: THINK Pascal Message-ID: <878@eutrc3.urc.tue.nl> Date: 28 Aug 89 13:21:49 GMT Reply-To: rcbaem@eutrc3.uucp Organization: Eindhoven University of Technology, The Netherlands Lines: 57 printf("Hello, World\n"); After adding a couple of variables to my program source, LSP suddenly crashes. It started with runtime crashes, and of course I thought it was entirely my own fault. But as far as I can tell my code doesn't contain anything wrong. The runtime error was either an address error or an illegal instruction, something or someone was apparently corrupting my code while it was running. Checking with LightsBug it seemed to be that the addresses of certain global variables were wrong. An array would be positioned somewhere in the middle of the program's code. Not on the stack. so a[i]:=0 would place a 0 somewhere in my code... Okay, the problem went further. At this time LSP crashes when either when compiling my project, or when linking it. Even when this is the first thing I do with a freshly booted LSP after opening my project. Even when I completely rebuild my entire project. I rather doubt it, but could it be something in my source code that causes this behaviour? The only weird thing in my source is a 2000 line procedure. (gives apr. 28K of code) But this procedure compiles just fine, and at times that compiling DOES work, the procedure is OK too. The weird thing is, when LSP doesn't crash when compiling or when Linking, the GO command crashes it (ID=02 or ID=03), but when I first build an application, and run the application, everything is fine! (????) Checking the debug option or not sometimes helps, sometimes doesn't. Another weird thing: Everything went just fine, until I added an array to the global variables of the program. According to LightsBug (putting Stops at strategic places) the runtime error occurs even before ANY value is given to ANY variable! Could it be: 1) The resource manager can't handle the project anymore? Since LSP stores all info in separate resources this could be a possibility. 2) My LSP is infected with a virus? (never had one ever, but who knows? nVIR was found on one of our University's HDs...) ((Hope this doesn't sound as 'my program stops when I turn my Mac off, could this be a Virus???')) 3) LSP can't handle very large procedures? (The code is still <32K though, and the source file hasn't reached the upper module size limit either) 4) I have too many variables to fit on the program's stack. (doubt it, I have had programs with many more variables) 5) LSP runs out of memory while compiling or linking? Doubt it because I have 2M of it.. Remains in doubts,... Ernst 'pooh' Mulder. > -------------------------------------- (How can I ever show you my emulated PC-2 when I can't even compile it anymore? Last time I compiled it it worked quite nice already...) --------------------------------------