0.8.2.53:
authorChristophe Rhodes <csr21@cam.ac.uk>
Thu, 21 Aug 2003 11:47:17 +0000 (11:47 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Thu, 21 Aug 2003 11:47:17 +0000 (11:47 +0000)
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.

src/code/condition.lisp
src/code/fd-stream.lisp
version.lisp-expr

index a62586a..a441310 100644 (file)
        (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 cc71851..ce07516 100644 (file)
     (: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
index d01d91b..102e8ac 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.2.52"
+"0.8.2.53"