From: Eli Zaretskii <eliz@gnu.org>
To: Jim Porter <jporterbugs@gmail.com>
Cc: larsi@gnus.org, emacs-devel@gnu.org
Subject: Re: esh-proc test failures
Date: Tue, 23 Aug 2022 14:37:25 +0300 [thread overview]
Message-ID: <83v8qj8a2y.fsf@gnu.org> (raw)
In-Reply-To: <f3107d06-4133-b1ee-ba24-e123f883ab9a@gmail.com> (message from Jim Porter on Mon, 22 Aug 2022 20:53:47 -0700)
> Cc: larsi@gnus.org, emacs-devel@gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
> Date: Mon, 22 Aug 2022 20:53:47 -0700
>
> >> The only thing that really needs to happen here is that the signal is
> >> caught so it doesn't bubble up past this point and break things.
> >
> > How do you accomplish that? On MS-Windows there's no SIGPIPE signal,
> > for example.
>
> If Eshell tries to write to a process object and it fails, it gets
> treated as a broken pipe. Technically, it signals 'eshell-pipe-broken',
> but that's roughly equivalent to SIGPIPE. This is mainly so that in a
> pipeline like "foo | bar", if "bar" terminates, Eshell can inform "foo"
> of the fact; on POSIX systems, it would send SIGPIPE, but on MS Windows,
> it just calls 'delete-process'. This is important because we want to be
> sure that if you have a pipeline like "yes | head", the "yes" gets
> stopped once "head" is done.
So you basically assume that _any_ problem in the pipe was due to
SIGPIPE? That could be too optimistic: it could be due to something
much more mundane and unrelated.
> > Not sure I understand completely what you are saying here, but AFAIR
> > writing to a closed pipe on MS-Windows will cause EINVAL errno.
>
> Indeed, it would be nice if we could force things so that an MS Windows
> program gets EINVAL for its WriteFile call, but because Eshell only
> interacts indirectly with the program's output, it's too late to do that
> by the time Eshell responds.
I don't think I follow. When the write fails, we get an error and
propagate it all the way up to the caller.
> >> I could expand the comment to explain that this value is
> >> somewhat-arbitrary and just designed to match GNU/Linux.
> >
> > Yes, please.
>
> How does the attached look?
Looks OK, but are you sure about the "128" part? shouldn't it be 256
instead? And perhaps explain why you add 128 (or whatever).
> Well, it depends on what we think users would expect. Currently, I don't
> think Eshell provides the necessary functionality to tell when the
> process "foo" fails (i.e. returns a non-zero exit status) in the
> pipeline "foo | bar".
But we can do that, right? The information about the exit status is
available to the SIGCHLD handler or a similar interface.
next prev parent reply other threads:[~2022-08-23 11:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <166036758418.2203.8730240669199078524@vcs2.savannah.gnu.org>
[not found] ` <20220813051305.6667BC09BFE@vcs2.savannah.gnu.org>
2022-08-14 18:06 ` esh-proc test failures Lars Ingebrigtsen
2022-08-14 18:44 ` Jim Porter
2022-08-22 17:06 ` Jim Porter
2022-08-22 18:56 ` Eli Zaretskii
2022-08-22 19:23 ` Jim Porter
2022-08-23 2:27 ` Eli Zaretskii
2022-08-23 3:53 ` Jim Porter
2022-08-23 11:37 ` Eli Zaretskii [this message]
2022-08-23 15:57 ` Jim Porter
2022-08-23 16:22 ` Eli Zaretskii
2022-08-23 16:38 ` Jim Porter
2022-08-30 3:18 ` Jim Porter
2022-08-30 16:51 ` Jim Porter
2022-08-30 20:56 ` Jim Porter
2022-08-31 20:52 ` Jim Porter
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/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=83v8qj8a2y.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=jporterbugs@gmail.com \
--cc=larsi@gnus.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
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).