[Prev][Next][Index][Thread]

Re: Crashes on reading file into fred buffer



On Sat, 3 Feb 1996 15:33:16 -0500, Paul Pangaro wrote:

>OK, so here's one I can't believe: with cl-http loaded, I have a file that
>I cannot Open without MCL crashing. I get the bomb icon, but no text
>appears - it crashes out before the text can appear, I guess, and the whole
>system locks.
>
>I've tried many things: re-loading the files onto disk, loading a new image
>of cl-http into MCL, running Norton. It occurs to me that the problem may
>have started when I inadvertantly turned on AutoDoubler on the LISP source
>files,but I have reloaded those from the server, and made a new image of
>cl-http. I can read and save the same file with SimpleText. Nothing
>prevents the crash in MCL, although I get it at different points: sometimes
>I can load most of a small system that the file is part of, sometimes I
>can't get that far, and I crash before I even get to the suspect file....
>Any ideas? (I _can_ open the file into Fred without cl-http loaded, but the
>system requires cl-http to load.)
>
>

It sounds like your bug is not triggered by cl-http in particular, but by 
loading a large system into MCL.  The first thing you should do is 
install macsbug (free) so you know why you are crashing.  I have had 
problems with MCL crashing when the mac heap needs to allocate more memory.

gb@digitool.com suggested the following fix, which has worked for me:

>Try to minimize the possibility of growzone happening at an inoopportune
>time by preallocating/disposing of a large block of mac memory:
>
>(defun preallocate-mac-memory (nbytes)
>  (let* ((p (#_NewPtr nbytes)))
>    (unless (ccl::%null-ptr-p p)
>      (#_DisposPtr p))))
>
>and calling (preallocate-mac-memory ...) before starting the http server.
>
>Determining the right value of "nbytes" requires a little bit of 
>experimentation; you want to cause what ROOM reports as "the Mac Heap"
>to grow as much as it needs to without starving the "lisp heap".

Christopher Vincent
cvince@ai.mit.edu


References: