Problems with wait-until-fd-usable on FIFO on OSX

Bug #1601927 reported by Stas Boukarev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Triaged
Medium
Unassigned

Bug Description

When the other end of a FIFO closes wait-until-fd-usable doesn't exit.
(let ((fifo #p"/tmp/fifo"))
  (unless (probe-file fifo)
    (sb-posix:mkfifo fifo #o644))
  (sb-thread:make-thread
   (lambda ()
     (with-open-file (stream fifo :direction :output :if-exists :overwrite)
       (write-char #\a stream))))
  (with-open-file (stream fifo)
    (print (read-char stream))
    (read-char stream nil :eof)))

returns :EOF on linux but blocks on OSX.

Stas Boukarev (stassats)
Changed in sbcl:
importance: Undecided → Medium
status: New → Triaged
tags: added: os-darwin streams
Stas Boukarev (stassats)
description: updated
Revision history for this message
Stas Boukarev (stassats) wrote :

I pushed a workaround in f88bdfb that always returns NIL in sysread-may-block-p on darwin for fifo streams. It breaks timeouts and interrupts but at least allows EOF to be signalled.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.