Update of /cvsroot/sbcl/sbcl/src/code
In directory sc8-pr-cvs1:/tmp/cvs-serv18101/src/code
Modified Files:
condition.lisp fd-stream.lisp
Log Message:
0.8.2.53:
Fixed hanging-on-reader-error in Darwin (and Solaris, it turns
out):
... Here's the deal: lseek(), on "certain devices", has
"unspecified consequences"
... said devices include, empirically, /dev/stdin
... so lseek was merrily returning a success code despite
clearly being incapable of rewinding the input stream
... so in our new error-reporting for reader errors, we were
assuming because of the success value that we could
read the erroneous input into a buffer...
... whereas we were rather sitting there waiting for more input.
... So protect the rereading code with an INTERACTIVE-STREAM-P.
Index: condition.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/condition.lisp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- condition.lisp 19 Jul 2003 14:36:13 -0000 1.36
+++ condition.lisp 21 Aug 2003 11:47:17 -0000 1.37
@@ -682,6 +682,17 @@
(let (lineno colno)
(when (and pos
(< pos sb!xc:array-dimension-limit)
+ ;; KLUDGE: lseek() (which is what FILE-POSITION
+ ;; reduces to on file-streams) is undefined on
+ ;; "some devices", which in practice means that it
+ ;; can claim to succeed on /dev/stdin on Darwin
+ ;; and Solaris. This is obviously bad news,
+ ;; because the READ-SEQUENCE below will then
+ ;; block, not complete, and the report will never
+ ;; be printed. As a workaround, we exclude
+ ;; interactive streams from this attempt to report
+ ;; positions. -- CSR, 2003-08-21
+ (not (interactive-stream-p error-stream))
(file-position error-stream :start))
(let ((string
(make-string pos
Index: fd-stream.lisp
===================================================================
RCS file: /cvsroot/sbcl/sbcl/src/code/fd-stream.lisp,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -d -r1.38 -r1.39
--- fd-stream.lisp 19 Aug 2003 15:42:42 -0000 1.38
+++ fd-stream.lisp 21 Aug 2003 11:47:17 -0000 1.39
@@ -871,7 +871,6 @@
(:element-type
(fd-stream-element-type fd-stream))
(:interactive-p
- ;; FIXME: sb!unix:unix-isatty is undefined.
(= 1 (the (member 0 1)
(sb!unix:unix-isatty (fd-stream-fd fd-stream)))))
(:line-length
|