all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Bryan C. Mills" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: Eli Zaretskii <eliz@gnu.org>, 48940@debbugs.gnu.org
Subject: bug#48940: 27.2; regression: "emacs --script /dev/stdin" parses the script incorrectly when /dev/stdin is a pipe
Date: Thu, 11 Nov 2021 12:23:38 -0500	[thread overview]
Message-ID: <CAKWVi_TRJcOpJ011UvHoBLQq=YvcrTQYwQwXMqk9HG7TvaZm+g@mail.gmail.com> (raw)
In-Reply-To: <87k0hfb7o3.fsf@gnus.org>

On Thu, Nov 11, 2021 at 12:09 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
>
> "Bryan C. Mills" <bcmills@google.com> writes:
>
> > I tested the fix locally with a small dummy script as input and it
> > seems to work, but I can't be confident that there won't be deeper
> > bugs. You're welcome to use it as a starting point for a more robust
> > fix.
>
> I tried (on Debian/bullseye with Emacs 29), but it doesn't seem to make
> any difference here.  With or without the patch, I get:
>
> larsi@xo:~/src/emacs/trunk$ emake; cat /tmp/script.el | ./src/emacs -Q --script /dev/stdin
> Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "/proc/162231/fd/pipe:[1065564]")
>   load("/proc/162231/fd/pipe:[1065564]" nil t t)
>   command-line-1(("-scriptload" "/dev/stdin"))
>   command-line()
>   normal-top-level()
>
> Perhaps something further has changed in the meantime?  (You didn't post
> an output of the error message you were getting...)

I did post the complete output: the pipeline `cat script.el | emacs
--no-init-file --no-site-file --script /dev/stdin` did not produce any
output whatsoever for my reproducer. (Nothing to stdout, nothing to
stderr.)

Since the return-value from lseek was ignored prior to my patch, the
failing seek did not necessarily lead to a diagnosed error at all — it
could instead result in a spurious EOF on the next read, or a parse
error from unintentionally continuing to read the file at the
unmodified (pre-lseek) offset.

I don't know what else may have regressed between when I mailed the
patch and when you looked at it in Emacs 29, and unfortunately I don't
have the time to look into it at the moment.





  reply	other threads:[~2021-11-11 17:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-09 20:31 bug#48940: 27.2; regression: "emacs --script /dev/stdin" parses the script incorrectly when /dev/stdin is a pipe Bryan C. Mills via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-06-13 10:26 ` Eli Zaretskii
2021-06-14 21:37   ` Bryan C. Mills via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-11  5:09     ` Lars Ingebrigtsen
2021-11-11 17:23       ` Bryan C. Mills via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2021-11-12  3:26         ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to='CAKWVi_TRJcOpJ011UvHoBLQq=YvcrTQYwQwXMqk9HG7TvaZm+g@mail.gmail.com' \
    --to=bug-gnu-emacs@gnu.org \
    --cc=48940@debbugs.gnu.org \
    --cc=bcmills@google.com \
    --cc=eliz@gnu.org \
    --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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.