Hi everyone,
I have a simple situation where SLIME (under CMUCL) fails - when fed certain (large) input.
Need: cl-csv package. Run cmucl from shell:
gene@daBox:~$ lisp CMU Common Lisp CVS release-18e-branch + minimal debian patches, running on daBox With core: /usr/lib/cmucl/lisp.core Dumped on: Wed, 2004-02-18 11:30:01-05:00 on daBox For support see http://www.cons.org/cmucl/support.html Send bug reports to the debian BTS. or to pvaneynd@debian.org type (help) for help, (quit) to exit, and (demo) to see the demos
Loaded subsystems: Python 1.1, target Intel x86 CLOS 18e (based on PCL September 16 92 PCL (f)) * (require 'csv)
; Loading #p"/usr/share/common-lisp/source/csv/csv.asd". ; Loading #p"/usr/lib/common-lisp/cmucl/csv/csv-src.x86f". T * (fare-csv:read-csv-line *terminal-io*) Date,/NGF0,/NGF0,/NGF0,/NGF0,/NGF0,/NGF0,/NGF0,/NGG0,/NGG0,/NGG0,/NGG0,/NGG0,/NGG0,/NGG0,/NGH0,/NGH0,/NGH0,/NGH0,/NGH0,/NGH0,/NGH0,/NGJ0,/NGJ0,/NGJ0,/NGJ0,/NGJ0,/NGJ0,/NGJ0,/NGK0,/NGK0,/NGK0,/NGK0,/NGK0,/NGK0,/NGK0,/NGM0,/NGM0,/NGM0,/NGM0,/NGM0,/NGM0,/NGM0,/NGN0,/NGN0,/NGN0,/NGN0,/NGN0,/NGN0,/NGN0,/NGQ0,/NGQ0,/NGQ0,/NGQ0,/NGQ0,/NGQ0,/NGQ0,/NGU0,/NGU0,/NGU0,/NGU0,/NGU0,/NGU0,/NGU0,/NGV0,/NGV0,/NGV0,/NGV0,/NGV0,/NGV0,/NGV0,/NGX0,/NGX0,/NGX0,/NGX0,/NGX0,/NGX0,/NGX0,/NGZ0,/NGZ0,/NGZ0,/NGZ0,/NGZ0,/NGZ0,/NGZ0
(:|Date| :/NGF0 :/NGF0 :/NGF0 :/NGF0 :/NGF0 :/NGF0 :/NGF0 :/NGG0 :/NGG0 :/NGG0 :/NGG0 :/NGG0 :/NGG0 :/NGG0 :/NGH0 :/NGH0 :/NGH0 :/NGH0 :/NGH0 :/NGH0 :/NGH0 :/NGJ0 :/NGJ0 :/NGJ0 :/NGJ0 :/NGJ0 :/NGJ0 :/NGJ0 :/NGK0 :/NGK0 :/NGK0 :/NGK0 :/NGK0 :/NGK0 :/NGK0 :/NGM0 :/NGM0 :/NGM0 :/NGM0 :/NGM0 :/NGM0 :/NGM0 :/NGN0 :/NGN0 :/NGN0 :/NGN0 :/NGN0 :/NGN0 :/NGN0 :/NGQ0 :/NGQ0 :/NGQ0 :/NGQ0 :/NGQ0 :/NGQ0 :/NGQ0 :/NGU0 :/NGU0 :/NGU0 :/NGU0 :/NGU0 :/NGU0 :/NGU0 :/NGV0 :/NGV0 :/NGV0 :/NGV0 :/NGV0 :/NGV0 :/NGV0 :/NGX0 :/NGX0 :/NGX0 :/NGX0 :/NGX0 :/NGX0 :/NGX0 :/NGZ0 :/NGZ0 :/NGZ0 :/NGZ0 :/NGZ0 :/NGZ0 :/NGZ0) * (quit)
As you can see, the function call is completed without any problem.
Now, try the same from SLIME:
; CMU Common Lisp Port: (33203 . localhost) Pid: 6518 CL-USER> (require 'csv) ; Loading #p"/usr/share/common-lisp/source/csv/csv.asd". ; Loading #p"/usr/lib/common-lisp/cmucl/csv/csv-src.x86f". T CL-USER> (fare-csv:read-csv-line *terminal-io*) Date,/NGF0,/NGF0,/NGF0,/NGF0,/NGF0,/NGF0,/NGF0,/NGG0,/NGG0,/NGG0,/NGG0,/NGG0,/NGG0,/NGG0,/NGH0,/NGH0,/NGH0,/NGH0,/NGH0,/NGH0,/NGH0,\ /NGJ0,/NGJ0,/NGJ0,/NGJ0,/NGJ0,/NGJ0,/NGJ0,/NGK0,/NGK0,/NGK0,/NGK0,/NGK0,/NGK0,/NGK0,/NGM0,/NGM0,/NGM0,/NGM0,/NGM0,/NGM0,/NGM0,/NGN0\ ,/NGN0,/NGN0,/NGN0,/NGN0,/NGN0,/NGN0,/NGQ0,/NGQ0,/NGQ0,/NGQ0,/NGQ0,/NGQ0,/NGQ0,/NGU0,/NGU0,/NGU0,/NGU0,/NGU0,/NGU0,/NGU0,/NGV0,/NGV\ 0,/NGV0,/NGV0,/NGV0,/NGV0,/NGV0,/NGX0,/NGX0,/NGX0,/NGX0,/NGX0,/NGX0,/NGX0,/NGZ0,/NGZ0,/NGZ0,/NGZ0,/NGZ0,/NGZ0,/NGZ0 ; Evaluation aborted CL-USER>
And this message shows up in the *inferior-lisp* buffer:
* ;; Connection to Emacs lost. ;; [ ; [GC threshold exceeded with 12,319,528 bytes in use. Commencing GC.] ; [GC completed with 1,037,136 bytes retained and 11,282,392 bytes freed.] ; [GC will next occur when at least 13,037,136 bytes are in use.]
Error in function COMMON-LISP::ASSERT-ERROR: Short read: length=5910572 pos=28]
Any suggestions?? --ET.
"E. Tyurin" evgeny@tyurin.com writes:
Error in function COMMON-LISP::ASSERT-ERROR: Short read: length=5910572 pos=28]
Any suggestions??
This is a bug in CMUCL's read-sequence and has been fixed in newer CMUCLs. I added a workaround for 18e in the latest SLIME version. You can either update SLIME or add the code below to your .cmucl-init.lisp.
Helmut.
(in-package :lisp)
(defun read-into-simple-string (s stream start end) (declare (type simple-string s)) (declare (type stream stream)) (declare (type index start end)) (unless (subtypep (stream-element-type stream) 'character) (error 'type-error :datum (read-char stream nil #\Null) :expected-type (stream-element-type stream) :format-control "Trying to read characters from a binary stream.")) ;; Let's go as low level as it seems reasonable. (let* ((numbytes (- end start)) (bytes-read (system:read-n-bytes stream s start numbytes t))) (if (< bytes-read numbytes) (+ start bytes-read) end)))