[Cl-store-devel] bug restoring long lists

Alain.Picard at memetrics.com Alain.Picard at memetrics.com
Wed Aug 31 04:11:01 UTC 2005


Dear Maintainers,

Under Lispworks and SBCL, trying to store
and restore a long list fails.  (SBCL can handle
a much, much longer list than LW, but still fails).

Here's what happens:

    XOS> (setq l (loop for i below 10000 collect i)
	       foo 'ok)
    OK
    XOS> (progn (store l "/tmp/list.1") 'ok)
    OK
    XOS> (progn (restore "/tmp/list.1") 'ok)
    ; Evaluation aborted
Raises:
Stack overflow (stack size 16000).
   [Condition of type CONDITIONS:STACK-OVERFLOW]

Restarts:
  0: [ABORT] Abort handling SLIME request.
  1: [ABORT] Quit process.

Backtrace:


    XOS> (let ((*check-for-circs* nil)) (progn (restore "/tmp/list.1") 'ok))
    ; Evaluation aborted
Raises same error.

The problem is non tail recursive manner in which it restores
lists as a nested series of conses.

I have a private patch, which just stores "proper lists" differently,
but I thought you'd want to know and perhaps implement something
better than my hack.

I notice you know have this *CHECK-FOR-CIRCS* variable (I was still
using an old version) --- perhaps when within a context of *CHECK-FOR-CIRCS*
of NIL you can dispatch to an entirely different (and stack-safe) algorithm?

Just a thought.

				--Alain Picard

p.s. please CC me; I'm not on this list (though maybe I should be...)

-- 
It would be difficult to construe        Larry Wall, in  article
this as a feature.			 <1995May29.062427.3640 at netlabs.com>



More information about the cl-store-devel mailing list