From: Herbert Kay
Subject: Memory expansion fails during GC inside the compiler under Lucid
Date: 
Message-ID: <l6eqcjINNcs@bathtub.cs.utexas.edu>
I am running the lucid common lisp development environment (aka sun
common lisp 4.0) under sunOS 4.1 with OpenWindows 2.0 on a
SparcStation2.  My problem concerns the interaction between the
compiler and the multitasking facility which is being used via
lispview (I'm not sure of the version number, however the
lispview.sbin file is dated 23 Aug 1990).

I make compiler calls within my code by way of the expression (compile
fname foo) where foo is a lambda expression.  My compiler options are:

	production mode
	compilation-speed = 0
	safety = 3
	speed = 2

Without lispview loaded, the garbage collector ends up being called
while in the compiler and, as it turns out, dynamic memory needs to be
expanded.  Lisp expands the memory and my application continues on its
merry way with no further calls to the garbage collector.

When lispview is loaded, lisp appears to be unable to expand dynamic
memory while in the compiler, even though I have not reached the
growth-limit for memory and there is still plenty of virtual memory
available.  It therefore disables dynamic and ephemeral garbage
collection and signals a continuable error.  I then do the following :

	1. Expand the memory by hand (via change-memory-management).
	2. Call the garbage collector by hand (via the gc).
	3. Reenable ephemeral garbage collection (via egc-on).
	3. Continue from the error.

and everything is fine.

So what's the deal here?  My surmise is that the multitasking facility
is interacting poorly with the compiler and garbage collector.  Why
can't the garbage collector expand memory while in the compiler with
lispview loaded?  Are there other gotchas like this that I should be
aware of when using the multitasking facility/lispview?  Also, how
does the multitasking facility get enabled (in the case above, I have
not even created any processes when all this happens).  I have seen
the variable lucid::*io-waits-with-process-wait* defined in the
default lisp-init file, but it is not documented in the multitasking
section of the advanced user's manual, and it seems to be true even
when I don't load anything into my lisp world.

Right now, I'm just expanding memory before running my application and
crossing my fingers that a GC won't happen while in the compiler.
Any advice on a better solution to this problem would be appreciated.


			- Bert Kay
			  ยทยทยทยท@cs.utexas.edu