Subject: bug#21993: REPL Servers broken on OSX.

From: Park SungMin <[email-masked]>
Date: Mon, 23 Nov 2015 23:03:53 +0900

Hello, I’m guile newbie. I use GNU Guile 2.0.11 on OSX.

I tested first... “guile —listen” on Terminal, then geiser-connect(geiser-20151029.1729) on Emacs(24.5.2)..
but I get Error Message…

second test… I run two guile. 
in server guile..
(use-modules (system repl server))
(spawn-server (make-tcp-server-socket))

then in client guile...
(define client (socket PF_INET SOCK_STREAM 0))
(connect client AF_INET (inet-aton "127.0.0.1") 37146)

I get same Error Message with first test…

I don’t know is it guile bug? … on Ubuntu, It works fine.
This is Backtrace… Thank you!

Backtrace:
In ice-9/boot-9.scm:
 157: 13 [catch #t #<catch-closure 110b24d20> ...]
In unknown file:
   ?: 12 [apply-smob/1 #<catch-closure 110b24d20>]
In ice-9/boot-9.scm:
 157: 11 [catch #t #<procedure 110b28ea0 at system/repl/server.scm:140:10 ()> ...]
In unknown file:
   ?: 10 [with-continuation-barrier #<procedure 110b24860 at system/repl/server.scm:158:3 ()>]
In ice-9/boot-9.scm:
 157: 9 [catch #t #<catch-closure 110b24840> ...]
In unknown file:
   ?: 8 [apply-smob/1 #<catch-closure 110b24840>]
In system/repl/server.scm:
 164: 7 [#<procedure 110b24860 at system/repl/server.scm:158:3 ()>]
In system/repl/repl.scm:
 142: 6 [start-repl* scheme #f #<procedure prompting-meta-read (repl)>]
 168: 5 [run-repl* # #<procedure prompting-meta-read (repl)>]
 123: 4 [#<procedure 110928620 at system/repl/repl.scm:118:4 (key . args)> system-error ...]
In ice-9/format.scm:
1593: 3 [format #<input-output: socket 14> "While reading expression:\n"]
 766: 2 [format:format-work "While reading expression:\n" ()]
  81: 1 [anychar-dispatch]
In unknown file:
   ?: 0 [write-char #\e #<input-output: socket 14>]

ERROR: In procedure write-char:
ERROR: In procedure fport_write: Resource temporarily unavailable
Backtrace:
In ice-9/boot-9.scm:
 157: 2 [catch #t #<catch-closure 110b24d20> ...]
In unknown file:
   ?: 1 [apply-smob/1 #<catch-closure 110b24d20>]
In ice-9/boot-9.scm:
 157: 0 [catch #t #<procedure 110b28ea0 at system/repl/server.scm:140:10 ()> ...]

ice-9/boot-9.scm:157:17: In procedure catch:
ice-9/boot-9.scm:157:17: In procedure fport_write: Resource temporarily unavailable