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: Wed, 9 Jun 2021 16:31:36 -0400 Message-ID: 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="31679"; mail-complaints-to="usenet@ciao.gmane.io" To: 48940@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 10 00:48:06 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 1lr6zW-00087s-Mx for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 10 Jun 2021 00:48:06 +0200 Original-Received: from localhost ([::1]:37998 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lr6zV-0003WB-Ot for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 09 Jun 2021 18:48:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr6yU-0002Vo-BO for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2021 18:47:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lr6yU-0007Wf-2m for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2021 18:47:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lr6yT-0007IU-Ut for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2021 18:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Bryan C. Mills" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 09 Jun 2021 22:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48940 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.162327878027997 (code B ref -1); Wed, 09 Jun 2021 22:47:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 9 Jun 2021 22:46:20 +0000 Original-Received: from localhost ([127.0.0.1]:34844 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lr6xm-0007HR-79 for submit@debbugs.gnu.org; Wed, 09 Jun 2021 18:46:20 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:36768) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lr4s7-00086w-61 for submit@debbugs.gnu.org; Wed, 09 Jun 2021 16:32:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51254) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr4s6-000097-St for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2021 16:32:18 -0400 Original-Received: from mail-vs1-xe2b.google.com ([2607:f8b0:4864:20::e2b]:33709) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lr4s3-0003F4-CC for bug-gnu-emacs@gnu.org; Wed, 09 Jun 2021 16:32:17 -0400 Original-Received: by mail-vs1-xe2b.google.com with SMTP id 126so703436vsi.0 for ; Wed, 09 Jun 2021 13:32:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=8sn7vsZOHg90lQy5W/GrHziR/UCCQWoVNREJcxOXMF4=; b=VFyrFAkj2FcocUieyuqo5gc9Pta92zVarch/87I/QDp+501qQlboOjYCqqi69z/nh3 Ev2fte3osCOtpwZ6Ety0ORZZVhNc7qK9IlPXh8BHqUJ2FXfJG4KfNo8u/9ZrveoSZSII 4vzNHhDEjhhEeZta8zAQ6GrYVgTXYF79wOA7gZc7r35X6IAA9bYRkAFkEdOpgLvnvEPC QuujQg9qH8GbrA2xds5NC8z+LcFmNGmeWGDEvG0zYMWp9Odlgw+tdx0BTXntrnqY9wYe HS0PIReENGbQpdC8Ly0rkahYbXa3qDoQN/Uao5KAfLP79IZZJCmVJffg3XqUERRp7lAf LS2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=8sn7vsZOHg90lQy5W/GrHziR/UCCQWoVNREJcxOXMF4=; b=oWo3DO46SbsUNUbKfojfkqjQBVGm5l/KxNqAOINg3i9OUolZdPzKhLMnKh2bYFVQ/l bkDXGYp1M0BQt0DqEO2eTRZCkq/cO1yGsd7F/pubZ2jl34NABJ2tAgwM9oK0V2RDZCbU ZlbXqTfnujBaFLqJt2xnKF61/TzQ7q/x5qYkjpvHfu6eVQmTlDGyXN+TiM9TrgoRoJ1M lIz8s3UwweHGTAn5XGdyfzwY3E4m6esYS3RH5rEk4lcHAXqpUuwt6daci9hBOjdLfImT aZs/gn7xeQRwO25YpIC+MZ2M3O1rKZPBwUbcG8EHq00tA3h/A1k9hPS+y3xhhAaa4966 8xIw== X-Gm-Message-State: AOAM532229fU36VOJRPTemqu71E2Q9ZNFJKywyUx4D6IOa3VsoJ6Hw3D A/TlYEXWhizMaJoxgues+mbmmkHPPISwPallJxg9+Wom7Knv4w== X-Google-Smtp-Source: ABdhPJxBrGFcOjhfN+jRPWUcGOUPBEHUJoP/WboHTF02pnW5VkCbWr1P+5JQvhaVcbQHv47EeoKavaJZI1OhIf85V1Q= X-Received: by 2002:a67:6505:: with SMTP id z5mr2223495vsb.43.1623270733002; Wed, 09 Jun 2021 13:32:13 -0700 (PDT) Received-SPF: pass client-ip=2607:f8b0:4864:20::e2b; envelope-from=bcmills@google.com; helo=mail-vs1-xe2b.google.com X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 09 Jun 2021 18:46:16 -0400 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:208308 Archived-At: `emacs --script /dev/stdin` worked reliably for me on Emacs 24 through 26. As of Emacs 27, it no longer works reliably =E2=80=94 depending on the scri= pt contents, it either fails with spurious errors or silently exits without finishing the script. In the following bash interaction, all three emacs invocations *should* run the same script. The third invocation demonstrates the bug: when /dev/stdin is a pipe from `= cat` (instead of the script.el file directly), the script is no longer interpret= ed. With other scripts, I get various errors, seemingly due to `;` or `"` characters being dropped or ignored from the input. ``` $ cat script.el | cat /dev/stdin (print "Hello emacs!") $ emacs --no-init-file --no-site-file --script script.el "Hello emacs!" $ emacs --no-init-file --no-site-file --script /dev/stdin is undefined [2 times] Making completion list... [2 times] Configured using: 'configure --build x86_64-linux-gnu --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --enable-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/google-emacs:/usr/local/share/google-emacs/2= 7.2+gg3+1.20210329.053400.rc147/site-lisp:/usr/local/share/google-emacs/sit= e-lisp:/usr/share/google-emacs/27.2+gg3+1.20210329.053400.rc147/site-lisp:/= usr/share/google-emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --program-prefix=3Dgoogle- --disable-silent-rules GOOGLE_VERSION=3D27.2+gg3+1.20210329.053400.rc147 --with-cairo --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars build_alias=3Dx86_64-linux-gnu 'CFLAGS=3D-g -O2 -ffile-prefix-map=3D/build/google-emacs-avRD2q/google-emacs-27.2+gg3+1.202= 10329.053400.rc147=3D. -fstack-protector-strong -Wformat -Werror=3Dformat-security -Wall' LDFLAGS=3D-Wl,-z,relro 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' 'OBJCFLAGS=3D-g -O2 -ffile-prefix-map=3D/build/google-emacs-avRD2q/google-emacs-27.2+gg3+1.202= 10329.053400.rc147=3D. -fstack-protector-strong -Wformat -Werror=3Dformat-security'' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LC_ALL: en_US.UTF-8 value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Text Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs text-property-search time-date subr-x seq mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils vc-git diff-mode easymenu easy-mmode cl-loaddefs cl-lib term/tmux term/xterm xterm byte-opt gv bytecomp byte-compile cconv tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 53224 7924) (symbols 48 6747 1) (strings 32 17548 1920) (string-bytes 1 565159) (vectors 16 8089) (vector-slots 8 89351 7266) (floats 8 29 624) (intervals 56 241 3) (buffers 1000 13))