TIP: Click on subject to list as thread! ANSI
echo: clipper
to: JW BERNDT
from: RAYMOND PESEK
date: 1997-07-26 03:42:00
subject: Nasty problem 1

JB ->      (0) Unrecoverable error 668: Eval stack fault
From the excellent treatise by Robert Montgomery, found in a file named
DGROUP.ZIP:
Unrecoverable Error 668 - Eval Stack Fault
This is caused by Eval Stack Overflow into Locked VM Segment.
Your program attempted to expand the Eval Stack into an area of DGROUP which
contains a locked VM segment.  Under low memory situations, the Clipper VM
will reallocate memory in DGROUP between the Eval Stack and the Memvar Table
to the conventional memory pool.  After this happens, if your program needs
to expand the Eval Stack into the reallocated memory, and that memory
contains a locked VM segment, you get this error.
Note that it is possible (but improbable) that this error may be generated
by infinite recursion, where the program runs out of Eval Stack before it
runs out of CPU Stack.  Also note that it is possible to get infinite
recursion by having an error in your error handling system, where an error
will generate a call to the error system, where another error generates
another call, and so on until the program runs out of Eval Stack.
When running under Protected Mode using a DOS Extender (i.e. Exospace), it is
very unlikely that this error will happen since there is plenty of memory
available, so that the VM will not need to reallocate memory from DGROUP.
See the section on DGROUP for more information.  Also, see DGROUP.ZIP in lib
2 of the CA-Clipper forum on Compuserve, which contains the Clipper source
code for fix_UE668(), a function which allows you to coerce the VMM into
leaving some more memory for the Eval Stack when it reallocates DGROUP.
Fix_UE668() is a Clipper function which creates a whole mess of local
variables and returns, which will move the "watermark" (see DGROUP) that
marks the highest expansion of the Eval Stack.  It should be called in one
of the first statements in your program.  If the number of local variables
declared and then released by Fix_UE668() is more than the total which will
be needed during the execution of your program, you will not get UE 668
anymore.
//
// fix_UE668() - version 2.0
//
// Used for "working around" a memory allocation "bug" or "incorrect
// allocation decision for some of us" in Clipper 5.0 - 5.2c (and probably
// later versions as well).
//
//
procedure fix_UE668(numlocvars)
  //
  // Causes a larger area of DGROUP to be allocated to to the Eval
  // Stack, which keeps it from being turned over to the VMM system
  // to be used as conventional memory.  This routine is used to prevent
  // the "Unrecoverable Error 668, Eval Stack Fault" error from happening.
  //
  // THIS ROUTINE DOES NOTHING TO HELP ANY OTHER ERROR, AND IN THE EVENT
  // THAT YOUR PROBLEM IS ANOTHER ERROR, THIS ROUTINE WILL PROBABLY MAKE
  // THINGS WORSE.
  //
  // This routine should be called as one of the first statements in your
  // program.  5.2 users may use rewrite this to use the INIT PROCEDURE
  // statement if they choose.
  //
  // This error occurs when the local variables for all currently executing
  // routines whose parameters and local variables are stored on the Eval
  // Stack fill the space allocated to them, and the VMM cannot release more
  // memory since the memory following the Eval Stack space has been
  // used for other purposes.
  //
  // parameter - numlocvars
  // This determines the number of local variables for which space is to
  // be allocated on the Eval Stack.  600 has worked well for me so far,
  // but it might be a bit excessive.  Allocating for more than you will
  // need may lead to "Conventional Memory Exhausted".
  //
  // The first statement in your program should be a call to this
  // routine, which will eat up enough Eval Stack space for your
  // program to run, then allow it to be reclaimed.  But after the
  // call, the VMM will not reallocate this space to the conventional
  // memory pool since it will think that your program might use it
  // again later for local variables.
  //
  // All this program really does is create a whole mess of local
  // variables initialized to nil, then return.
  //
  // This routine accepts one parameter, indicating the number of local
  // variables for which space is to be allocated. This routine only
  // works for multiples of 50 variables.  The number you give is
  // rounded down to the nearest multiple of 50.
  //
  // If you get one of following unrecoverable errors after using this:
  //   1. UE 667 Eval Stack Fault (Eval Stack overrun of Memvar Table)
  //      You are allocating too much space with fix_UE668().  Reduce the
  //      number of variables to be allocated or eliminate the call to
  //      fix_UE668().
  //   2. UE  conventional memory exhausted - similar to item #1.
  //   3. UE 668 Eval Stack Fault (Eval Stack attempted overrun of memory
(Continued to next message)
 * 1st 2.00 #2448 * Moderator - Clipper Echo
--- InterEcho 1.19
---------------
* Origin: PC-Ohio PCBoard * Cleveland, OH * 216-381-3320 (1:157/200)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.