From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Bryan C. Mills" via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <83pmwq6oxc.fsf@gnu.org> <87k0hfb7o3.fsf@gnus.org> Reply-To: "Bryan C. Mills" Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7004"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , 48940@debbugs.gnu.org To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 11 18:25:14 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mlDp3-0001ay-Gq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 18:25:13 +0100 Original-Received: from localhost ([::1]:45086 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mlDp2-0002ED-8t for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 12:25:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:42478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mlDos-0002E5-24 for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 12:25:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58829) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mlDor-0003yH-OQ for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 12:25:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mlDor-0004av-LK for bug-gnu-emacs@gnu.org; Thu, 11 Nov 2021 12:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Bryan C. Mills" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Nov 2021 17:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48940 X-GNU-PR-Package: emacs Original-Received: via spool by 48940-submit@debbugs.gnu.org id=B48940.163665146217606 (code B ref 48940); Thu, 11 Nov 2021 17:25:01 +0000 Original-Received: (at 48940) by debbugs.gnu.org; 11 Nov 2021 17:24:22 +0000 Original-Received: from localhost ([127.0.0.1]:42142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlDoE-0004Zu-18 for submit@debbugs.gnu.org; Thu, 11 Nov 2021 12:24:22 -0500 Original-Received: from mail-ua1-f49.google.com ([209.85.222.49]:43837) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mlDoC-0004Zg-9Y for 48940@debbugs.gnu.org; Thu, 11 Nov 2021 12:24:20 -0500 Original-Received: by mail-ua1-f49.google.com with SMTP id v3so13289744uam.10 for <48940@debbugs.gnu.org>; Thu, 11 Nov 2021 09:24:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LXCKPpJZ+Zd6TtYZwr510kAMBVJEybkkTYSYI0jNauY=; b=bEOzyJKsG3KXHEkQohJ4fkRaSJaBvtCFQjzywbCUz18O4axZhb7+r5ugw2DPNtc2Hf wKR93aRsurW4bE+EpJtN2NqloHbQHYCbRdZDB3Xe1S1gP5aLnKH8I8jHQjH4lY0S85HH LaKJnqKU16+pT4J/26e6zIqGhU+DS1UMxuBqPlIeHWaXbkfgkuoawc+4UUNtACPWHpZl nveXYonS3/zmseNekYRoWF6aiaD8LU2q9laVm8spZmQ2Y95As0MD43xnKhG4+2nkveOi pzd/oeFvqE3j2BLQfW4VV5/ezmgUAU3b0p0xYg1/3dI6GqdVjmHz+4ycxyKX4Sy8XFNl 02sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LXCKPpJZ+Zd6TtYZwr510kAMBVJEybkkTYSYI0jNauY=; b=nPbO1za3aI1255f5X9p3kI+IRc8SJEHx9pXm9dOtFq4RjCPEonAjiuOHAm6vmejC/e hQxm9aELbmpDKiOcMFFmgMyk4FknSgKaM6JEnJei/3aaXgsU4c8PGJCoWdwf2+BiAWcp FN0fZwIRdyTTrV2n0Ll/YSy6CsrbpkiJwPTRSr0mS6JRMOoIf0wCUcOQKzV30ElnhAbe +OdhN2Xds8Jz92isBAUg8ghrSnzikmKEkKAFwWR1yORqdF/Gew6g0gsrKrvYd3dVTLQu o+8pqRVdGqIpX8plbihNeq9ONbub90FPLMMqsVM64agjvLkzZRzSJ7JV7LpD6p6r08Oh 5HQA== X-Gm-Message-State: AOAM532d/CSNZVYheXQKFPnHrcjHuTkViZOSjo9W3YewjSuc7oeIgIQt ivhBdViZNP4zDTHGDaPPslXq9iJcx/bQB1/y18UVYobhIOw= X-Google-Smtp-Source: ABdhPJyHNv0g6nANsrkd+yD/3CnD00hUs1vHp3ZTyFWeHDTZkC+Xu6gXjvMundboKZ4aH3zZsipanLRkyv55+1Farq8= X-Received: by 2002:a05:6102:3f4c:: with SMTP id l12mr396646vsv.7.1636651454331; Thu, 11 Nov 2021 09:24:14 -0800 (PST) In-Reply-To: <87k0hfb7o3.fsf@gnus.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219657 Archived-At: On Thu, Nov 11, 2021 at 12:09 AM Lars Ingebrigtsen wrote: > > "Bryan C. Mills" 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 s= uch 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 =E2=80=94= 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.