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

Bug#148926: clisp eats whole memory



Package: clisp
Version: 1:2.27-0.5
Severity: important

Following sequence produce this effect:
  (jtms-init)
  (setq a (install-node 'a))
  (setq b (install-node 'b))
  (install-just a (list b))

I found that this problem has something to do with push and defstruct.
In harlequin lisp (lispworks) program worked without problems.
When I replaced defstruct with defclass, problem disappeared in clisp
too.

-- System Information
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux pisidlo 2.2.20 #1 Sun Feb 24 20:26:35 CET 2002 i686
Locale: LANG=cs_CZ, LC_CTYPE=cs_CZ

Versions of packages clisp depends on:
ii  libc6                    2.2.5-4         GNU C Library: Shared libraries an
ii  libncurses5              5.2.20020112a-7 Shared libraries for terminal hand
(defstruct node
  (index 0)
  (datum nil)
  (label 'out)
  (support nil)
  (justifications nil)
  (consequences nil)
)  

(defstruct justification
  (index 0)
  in-list
  out-list
  consequence
)

(defvar *node-counter*)
(defvar *just-counter*)

(defun in-node? (node) (eq (node-label node) 'in))

(defun out-node? (node) (eq (node-label node) 'out))

(defun jtms-init ()
  (setq *node-counter* 0
	*just-counter* 0)
)

(defun install-node (datum)
  (let (node)
    (setq node (make-node :datum datum :index (incf *node-counter*)))
))

(defun install-just (conseq in-supp &optional (out-supp nil))
  (let (just)
    (setq just (make-justification :index (incf *just-counter*)
				   :in-list in-supp
				   :out-list out-supp
				   :consequence conseq))
;  (setf (node-justifications conseq)
;	(append (node-justifications conseq) just))
    (push just (node-justifications conseq))
    just
))




Reply to: