Subject: `write-byte-sequence' error?

From: Erik Arneson <[email-masked]>
Date: Wed, 6 Oct 1999 13:19:15 -0700 (PDT)

Howdy,

I think I may have found another bug in the 1999-09-30 snapshot.  I'm
using handler-case to catch stream errors on a file transfer over a
network socket.

Anyhow, it seems to catch most errors just fine, but
`write-byte-sequence' on a socket which has been closed from the other
end causes clisp to exit with a 'Broken pipe' message, and nothing
else.  Shouldn't that be caught by handler-case?

Here's some code to replicate the error:

(setf packet (make-array 1024
                         :element-type '(unsigned-byte 8)))
(setf srv (socket-server 4444))
(setf sock (socket-accept srv
                          :element-type '(unsigned-byte 8)
                          :buffered nil))
;; From another terminal telnet in and set your client to character
;; mode.
(handler-case
 (write-byte-sequence packet sock)
 (error (err)
        (princ err)))
;; Now disconnect your telnet client and try the `handler-case' clause
;; again.

I wish I knew enough C to help debug CLISP itself.  :(  I hope this
helps, regardless!  Thanks for the excellent Lisp software!

-- 
# Erik Arneson      [email-masked]    Webring Software Engineer #
# Yahoo! Inc.      PGP ID: 2048/84413E19        (541) 482-3000x114 #
# "There's such a fine line between stupid and clever." Spinal Tap #

---

From: Bruno Haible <[email-masked]>
Date: Wed, 6 Oct 1999 23:49:38 +0200 (MET DST)

> else.  Shouldn't that be caught by handler-case?

Thanks for reporting this, and the easily reproducible code. It will be
fixed in tomorrow's snapshot.

Bruno