[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing to closed network port causes guile to exit with error 141,

From: Chris Vine
Subject: Re: Writing to closed network port causes guile to exit with error 141, not error message
Date: Sat, 23 Mar 2024 12:09:15 +0000

On Fri, 22 Mar 2024 19:00:43 -0400
Ryan Raymond <> wrote:
> Thank you, Thomas.
> I do wonder if this is good behavior to have in Guile. I feel like we
> should replace that signal with an error. It's not good for programs to
> exit without an explanation.
> However, thank you for your help.
> Ryan

I suppose the justification for leaving things as they are is that it
is consistent with POSIX.  Amongst the first things that any POSIX
application writing to a socket has to do is to set SIG_IGN as the
handler for SIGPIPE so that writing to a closed socket causes errno to
be set to EPIPE instead of the write raising a SIGPIPE signal.

You could argue that the POSIX defaults are wrong: another socket
configuration which is often needed is to set SO_REUSEADDR on the
socket, which you would have thought should be the default.  The
argument for SIGPIPE is that it is necessary in order to obtain the
correct behaviour when piping at the unix shell: you do want a signal to
terminate the chain of pipes in that case if one is broken.  But how
often do you pipe executables at the unix shell writing to sockets?
Approximately never.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]