[Ecls-list] Fatal gc errors compiling cl-http: around methods

Karsten Poeck karsten.poeck at gmail.com
Sun Nov 13 04:32:59 UTC 2005


Hello,
I am trying to compile cl-http with ecl (Windows XP, Visual C++ Compiler 2003).

I have noted a lot of gc crashes while compiling the system. A good 
example is the following that results in:
Fatal error in gc
Too many heap sections
I had the same error with mingw, so I think it is a general ecl issue.

salud2

Karsten

(in-package :cl-user)

(defclass basic-data-cache ()())
(defclass file-data-cache-mixin ()())

(defgeneric recache-data (data-cache &optional stream length)
   (:documentation "Recaches the data in DATA-CACHE.
STREAM is an input stream to the data source.
LENGTH is number of bytes to read into the cache."))

(defmethod recache-data ((data-cache basic-data-cache) &optional stream length)
   (unless (and stream length)
     (error "No data stream and data size were provided."))
   (let ((new-array (allocate-resource 'data-cache-array length))
	(ut (get-universal-time))
	old-array old-size offset)
     ;; obtain new data
     (setq new-array (binary-stream-copy-into-8-bit-array stream 
length 0 new-array))
     ;; Use lock only around the actual update to minimize latency
     (with-data-cache-lock (data-cache :write)
       (setf old-array (data-cache-array data-cache)
	    old-size (data-cache-size data-cache)
             (data-cache-array data-cache) new-array
	    (data-cache-size data-cache) length
	    (data-cache-update-time data-cache) ut)
       (data-cache-reset-revalidation-time data-cache ut))
     (cond
       (old-array
	(deallocate-resource 'data-cache-array old-array))
       ;; Update cache indices
       ((and old-size (not (zerop (setq offset (- length old-size)))))
        (data-universe-increment-total-cache-size 
(data-cache-universe data-cache) offset)))))

(defmethod recache-data :around ((data-cache file-data-cache-mixin) 
&optional file-stream length)
   (multiple-value-prog1 (call-next-method data-cache file-stream (or 
length (file-length-in-bytes file-stream)))
     (setf (data-cache-last-modification data-cache) 
(file-stream-modification-date file-stream)
           (data-cache-version data-cache) (file-stream-version file-stream))))

->
C:\Programs\ecl>ecl
ECL (Embeddable Common-Lisp) 0.9h
Copyright (C) 1984 Taiichi Yuasa and Masami Hagiya
Copyright (C) 1993 Giuseppe Attardi
Copyright (C) 2000 Juan J. Garcia-Ripoll
         ECL is free software, and you are welcome to redistribute it
under certain conditions; see file 'Copyright' for details.
Type :h for Help.  Top level.
 > (compile-file "test-around.lisp")
;;; Loading #P"C:/Programs/ecl/cmp.fas"
;;; Loading #P"C:/Programs/ecl/sysfun.lsp"
;;; Compiling test-around.lisp.
;;; Compiling (DEFCLASS BASIC-DATA-CACHE ...).
;;; Compiling (DEFCLASS FILE-DATA-CACHE-MIXIN ...).
;;; Compiling (DEFGENERIC RECACHE-DATA ...).
;;; Compiling (DEFMETHOD RECACHE-DATA ...).
;;; Note: Replacing variable G58 by its value #<form VAR D12D50>
;;; Note: Replacing variable G59 by its value #<form VAR D12CF0>
;;; Note: Replacing variable G60 by its value #<form VAR D16930>
;;; Note: Replacing variable G61 by its value #<form VAR D168D0>
;;; Note: Replacing variable G62 by its value #<form VAR D19690>
;;; Note: Replacing variable G63 by its value #<form VAR D19630>
;;; Compiling (DEFMETHOD RECACHE-DATA ...).





More information about the ecl-devel mailing list