From xemacs-m  Thu Feb 27 23:35:04 1997
Received: from altair.xemacs.org (steve@xemacs.miranova.com [206.190.83.19])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id XAA18857
	for <xemacs-beta@xemacs.org>; Thu, 27 Feb 1997 23:35:03 -0600 (CST)
Received: (from steve@localhost)
	by altair.xemacs.org (8.8.5/8.8.5) id VAA27005;
	Thu, 27 Feb 1997 21:46:47 -0800
Mail-Copies-To: never
To: xemacs-beta@xemacs.org
Subject: [20.1] Fixes for dumping strangeness with too-low PURESIZE.
References: <199702272243.QAA10770@lks.cadence.com>
X-Url: http://www.miranova.com/%7Esteve/
X-Face: #!T9!#9s-3o8)*uHlX{Ug[xW7E7Wr!*L46-OxqMu\xz23v|R9q}lH?cRS{rCNe^'[`^sr5"
 f8*@r4ipO6Jl!:Ccq<xoV[Qz2u8<8-+Vwf2gzJ44lf_/y9OaQ`@#Q65{U4/TC)i2`~/M&QI$X>p:9I
 OSS'2{-)-4wBnVeg0S\O4Al@)uC[pD|+
X-Attribution: sb
From: Steven L Baur <steve@miranova.com>
In-Reply-To: "Oswald P. Backus IV"'s message of Thu, 27 Feb 1997 16:44:09 -0600
Mime-Version: 1.0 (generated by tm-edit 7.105)
Content-Type: text/plain; charset=US-ASCII
Date: 27 Feb 1997 21:46:43 -0800
Message-ID: <m2zpwpmqik.fsf@altair.xemacs.org>
Lines: 79
X-Mailer: Gnus v5.4.15/XEmacs 20.1

I found two bugs that can strike while dumping lisp when PURESIZE is
too low.  Please apply these patches if you have experienced problems
or even if you haven't.  To test, set the value of PURESIZE in
PURESIZE.h to something ridiculous like 10k.  That always coredumped
on me before.

Perhaps someone with more history in XEmacs than me can comment on the
code in Fpurecopy?

Index: alloc.c
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/src/alloc.c,v
retrieving revision 1.4
diff -u -r1.4 alloc.c
--- alloc.c	1997/02/27 06:08:42	1.4
+++ alloc.c	1997/02/28 05:31:38
@@ -217,7 +217,9 @@
     }
   else if (pureptr + size > PURESIZE)
     {
-      message ("\nERROR:  Pure Lisp storage exhausted!\n");
+      /* This can cause recursive bad behavior, we'll yell at the end */
+      /* when we're done. */
+      /* message ("\nERROR:  Pure Lisp storage exhausted!\n"); */
       pure_lossage = size;
       return (0);
     }
@@ -2574,12 +2576,14 @@
           {
             struct Lisp_Compiled_Function *o = XCOMPILED_FUNCTION (obj);
             Lisp_Object new = make_compiled_function (1);
-            struct Lisp_Compiled_Function *n = XCOMPILED_FUNCTION (obj);
+	    /* How on earth could this code have worked before?  -sb */
+            struct Lisp_Compiled_Function *n = XCOMPILED_FUNCTION (new);
             n->flags = o->flags;
             n->bytecodes = Fpurecopy (o->bytecodes);
             n->constants = Fpurecopy (o->constants);
             n->arglist = Fpurecopy (o->arglist);
             n->doc_and_interactive = Fpurecopy (o->doc_and_interactive);
+	    n->maxdepth = o->maxdepth;
             return (new);
           }
 #ifdef LISP_FLOAT_TYPE
@@ -4223,6 +4227,11 @@
   Lisp_Object pl = Qnil;
   Lisp_Object ret[6];
   int i;
+
+  if (purify_flag && pure_lossage)
+    {
+      return Qnil;
+    }
 
   garbage_collect_1 ();
 

Index: lstream.c
===================================================================
RCS file: /usr/local/xemacs/xemacs-20.0/src/lstream.c,v
retrieving revision 1.2
diff -u -r1.2 lstream.c
--- lstream.c	1997/01/23 05:30:11	1.2
+++ lstream.c	1997/02/28 03:21:46
@@ -282,11 +282,7 @@
 static void
 signal_simple_internal_error (CONST char *reason, Lisp_Object obj)
 {
-#ifdef DEBUG_XEMACS
-  abort ();
-#else
   signal_simple_error (reason, obj);
-#endif
 }
 
 void

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be billed at $250/message.

