[comp.lang.lisp.x] XLISP SAVE/RESTORE ???

stickler@cc.helsinki.fi (02/27/90)

Is there a fix for XLISP 2.x SAVE()/RESTORE() ?
My PC version (downloaded from BIX) saves without error, but
complains when restoring.


//////////////////////////////////////////////////////////////////////
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Patrick Stickler  University of Helsinki   stickler@hylka.helsinki.fi
   (BIX: nrc)     Nokia Research Center    stickler@pepper.rc.nokia.fi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//////////////////////////////////////////////////////////////////////

toma@tekgvs.LABS.TEK.COM (Tom Almy) (02/28/90)

In article <1973.25ea7b8e@cc.helsinki.fi> stickler@cc.helsinki.fi writes:
>Is there a fix for XLISP 2.x SAVE()/RESTORE() ?
>My PC version (downloaded from BIX) saves without error, but
>complains when restoring.

There are three separate problems that affect version 2.0 and 2.1. 
(There are dozens of other bugs as well -- I mail out bugfixed sources
upon receipt of a disk and stamped mailer)

*******************
Problem: "restore" corrupts system.
Diagnosis: argument stack not being reset -- initial garbage collect
 "marks" random memory!

Solution: Add to "initialize" in xlirestore:


	xlfp = xlsp = xlargstkbase;
	*xlsp++ = NIL;

*******************
Problem: "restore" corrupts system with 8086 compilers.
Diagnosis: cvoptr is doing improper arithmetic.

Solution: CVPTR in xlisp.h needs to be defined as 
#define CVPTR(x)	((((unsigned long)(x) >> 16) << 4) + ((unsigned) x))
	return statement in cvoptr() (xlimage.c) needs to be changed from:
return (off + (OFFTYPE)((p - seg->sg_nodes) << 1));
	to:
return (off+(((CVPTR(p)-CVPTR(seg->sg_nodes))/sizeof(struct node))<<1));


Note: for this to work with non-8086 compilers, the default for CVPTR
should be changed from (x) to ((OFFTYPE)(x)).

****************

BUG: Any attempt to do more than one RESTORE in a session causes the error
	"insufficient memory - segment".

SOLUTION:
In file xlimage.c, function freeimage(), change

		if (((fp = getfile(p)) != 0) && (fp != stdin && fp != stdout))

to:

		if (((fp = getfile(p)) != 0) && 
			 (fp != stdin && fp != stdout && fp != stderr))



=============================

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply

stickler@cc.helsinki.fi (03/01/90)

In article <6958@tekgvs.LABS.TEK.COM>, toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:
> In article <1973.25ea7b8e@cc.helsinki.fi> stickler@cc.helsinki.fi writes:
>>Is there a fix for XLISP 2.x SAVE()/RESTORE() ?
>>My PC version (downloaded from BIX) saves without error, but
>>complains when restoring.
> 
> There are three separate problems that affect version 2.0 and 2.1. 
> (There are dozens of other bugs as well -- I mail out bugfixed sources
> upon receipt of a disk and stamped mailer)
> 
> *******************
> Problem: "restore" corrupts system.
> Diagnosis: argument stack not being reset -- initial garbage collect
>  "marks" random memory!
> 
> Solution: Add to "initialize" in xlirestore:
> 
> 
> 	xlfp = xlsp = xlargstkbase;
> 	*xlsp++ = NIL;
> 
> *******************
> Problem: "restore" corrupts system with 8086 compilers.
> Diagnosis: cvoptr is doing improper arithmetic.
> 
> Solution: CVPTR in xlisp.h needs to be defined as 
> #define CVPTR(x)	((((unsigned long)(x) >> 16) << 4) + ((unsigned) x))
> 	return statement in cvoptr() (xlimage.c) needs to be changed from:
> return (off + (OFFTYPE)((p - seg->sg_nodes) << 1));
> 	to:
> return (off+(((CVPTR(p)-CVPTR(seg->sg_nodes))/sizeof(struct node))<<1));
> 
> 
> Note: for this to work with non-8086 compilers, the default for CVPTR
> should be changed from (x) to ((OFFTYPE)(x)).
> 
> ****************
> 
> BUG: Any attempt to do more than one RESTORE in a session causes the error
> 	"insufficient memory - segment".
> 
> SOLUTION:
> In file xlimage.c, function freeimage(), change
> 
> 		if (((fp = getfile(p)) != 0) && (fp != stdin && fp != stdout))
> 
> to:
> 
> 		if (((fp = getfile(p)) != 0) && 
> 			 (fp != stdin && fp != stdout && fp != stderr))
> 
> 
> 
> =============================
> 
> Tom Almy
> toma@tekgvs.labs.tek.com
> Standard Disclaimers Apply


Thanks, but what if I'm not a C programmer and have no compiler...?


pms.

toma@tekgvs.LABS.TEK.COM (Tom Almy) (03/02/90)

In article <1983.25ec0a64@cc.helsinki.fi> stickler@cc.helsinki.fi writes:
>In article <6958@tekgvs.LABS.TEK.COM>, toma@tekgvs.LABS.TEK.COM (Tom Almy) writes:

>> In article <1973.25ea7b8e@cc.helsinki.fi> stickler@cc.helsinki.fi writes:

>>>Is there a fix for XLISP 2.x SAVE()/RESTORE() ?

>> [list of patches for the XLISP source code]

>Thanks, but what if I'm not a C programmer and have no compiler...?


Then you are out of luck because you have no way to patch the source code
and recompile! You need to get the sources and get someone to compile it
with the changes.

Tom Almy
toma@tekgvs.labs.tek.com
Standard Disclaimers Apply