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

Re: [spr5927] Running old Lisp-program



[This matter has been assigned the tracking identifier "spr5927".
Please refer to it in any followup communication.  Also, be sure
to cc bugs@franz.com so that if I am unavailable someone else will
be able to respond.]

   I have a Lisp-application which currently run sun4 with Allegro 4.0.1.

   Now, I need to run a couple of years old version on Sun3. I do have
   the old binary which have been saved by using dumplisp. If I now try run
   that version I get a message:
     The environment this lisp is running has used
     up too much stack. It cannot be restarted

   I checked with 'pstat -s' that I have enough swap space. 
   So, what is going wrong ?
   What should I do ?

   I cannot load&dump the application again, because I have the old source-code
   only from the components written by my self.

In retrospect, this particular failure message is very badly written
and it's no surprise that user's can't understand it.  We'll see that
it is improved in the next release.  Meanwhile, I'll explain what's
failing and what you *might* be able to do about it.

When Unix starts an excutable, it copies the ``command-line''
arguments and the environment variables to the top of the stack
segment, set's the process' initial stack pointer just below that
data, and then starts the process executing.  A dumplisp copy of an
Allegro executable, however, is really a carefully crafted file that
in a certain sense causes execution of the pre-dumplisp image to
_resume_ executing with the same heap (i.e. data segment) carefully
restored to memory, and in particular, with (mostly) the same data on
the stack.  The restarting dumplisp goes through some work to copy
it's pre-dumplisp stack context onto the stack.  Now, this data on the
stack cannot be relocated, so if the pre-dumplisp stack data cannot be
reestablished at the same address Allegro cannot run, so it prints
this rather cryptic message and exits.

There are two reasons that the stack could not be reestablished at the
same address:

 (1) The user who is executing has consumed a lot more space in his
shell environment than the user who initially built the lisp.  Allegro
tries to protect against this by allocating a couple K of unused stack
storage at startup, but sometimes this isn't enough.  So, you can try
running you program after removing all the shell environment variables
that you can, or else by running as a fake user with a minimal amount
of environment.  (You can see what's in your environment by typing
"printenv" at the shell.)

  (2) More likely, your old Lisp executable was built on an earlier
version of SunOS, and in that version the virtual address of the stack
segment is very different than in your current OS.  I believed this
happened between Sun3 SunOS 4.0 and SunOS 4.1 -- Allegro executables
need to be built separately for each version.  Unfortunately, the only
good solution for this is to rebuild Allegro, but you say you can't do
this.  Another drastic workaround would be to find a machine still
running the earlier OS, or restore that OS to a machine.

If (2) is the problem I don't know if my suggestions will be practical
for you, but at least you now know what's happening.  Let us know if
we can be of further help on this problem.