unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Chris Vine <vine.chris@gmail.com>
To: Ryan Raymond <rjraymond@oakland.edu>
Cc: Guile User <guile-user@gnu.org>
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	[thread overview]
Message-ID: <20240323120915.913e49fa6aa5656e4f9fb5bf@gmail.com> (raw)
In-Reply-To: <CAGvJ-HThU9YKc2m2QjDCu3pBcWX1f-KW496xLvi0qftsfUiJ2w@mail.gmail.com>

On Fri, 22 Mar 2024 19:00:43 -0400
Ryan Raymond <rjraymond@oakland.edu> 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.

Chris



      reply	other threads:[~2024-03-23 12:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22 14:22 Writing to closed network port causes guile to exit with error 141, not error message Ryan Raymond
2024-03-22 16:05 ` Tomas Volf
2024-03-22 23:00   ` Ryan Raymond
2024-03-23 12:09     ` Chris Vine [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240323120915.913e49fa6aa5656e4f9fb5bf@gmail.com \
    --to=vine.chris@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=rjraymond@oakland.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).