GNU bug report logs - #28997
27.0.50; Error in async shell-command process filter

Previous Next

Package: emacs;

Reported by: "Basil L. Contovounesios" <contovob <at> tcd.ie>

Date: Wed, 25 Oct 2017 16:27:01 UTC

Severity: normal

Tags: patch

Found in version 27.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 28997 in the body.
You can then email your comments to 28997 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Wed, 25 Oct 2017 16:27:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to "Basil L. Contovounesios" <contovob <at> tcd.ie>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 25 Oct 2017 16:27:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; Error in async shell-command process filter
Date: Wed, 25 Oct 2017 16:50:01 +0100
[backtrace.txt (text/plain, attachment)]
[0001-Fix-buffer-name-comparison-in-async-shell-command.patch (text/x-diff, attachment)]
[0002-lisp-simple.el-shell-command-Simplify-cond-with-pcas.patch (text/x-diff, attachment)]
[Message part 4 (text/plain, inline)]
# Steps to reproduce

1) emacs -Q
2) M-x set-variable RET
   async-shell-command-display-buffer RET
   nil RET
3) M-: (async-shell-command
        "ls ~" (generate-new-buffer "home")) RET

This results in the following error:

  error in process filter: Wrong type argument:
    stringp, #<buffer home>

I attach the relevant backtrace.

# Diagnosis

When async-shell-command-display-buffer is nil, the async
shell-command process filter passes output-buffer, which
could be a buffer object, to string=.

# Patch

I attach two patches to address this issue.

The first patch replaces the quoted lambda process filter
with a closure over the name of output-buffer.  By keeping
track of this name, a lot of the surrounding
buffer-name-determining code can be simplified via DRY.

The second patch is purely aesthetic and simplifies the cond
that is touched by my first patch into an equivalent pcase.

# Environment

In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2017-10-25 built on thunk
Repository revision: 090f4f157eea6f0d0d13963520f5e05706de142f
Windowing system distributor 'The X.Org Foundation', version 11.0.11905000
System Description:	Debian GNU/Linux testing (buster)

Recent messages:
Configuring package avy...done
Configuring package ace-window...done
Configuring package mm-decode...done
Configuring package dired...done
Loading /home/blc/.emacs.d/eudc-options...
Loading eudcb-bbdb...
Configuring package bbdb...done
Loading eudcb-bbdb...done
Loading /home/blc/.emacs.d/eudc-options...done
Configuring package message...done

Configured using:
 'configure --prefix=/home/blc/.local
 --enable-locallisppath= --with-mailutils --with-sound=yes
 --with-x-toolkit=lucid --with-xpm --with-jpeg --with-tiff
 --with-gif --with-png --with-rsvg --with-libsystemd
 --with-xml2 --with-imagemagick --with-xft --with-libotf
 --with-m17n-flt --with-toolkit-scroll-bars --with-xaw3d
 --with-xim --with-gpm --with-dbus --with-gsettings
 --with-selinux --with-gnutls --with-zlib --with-modules
 --with-threads --with-file-notification=yes --with-x
 --without-gconf --with-lcms2 'CFLAGS=-flto
 -fomit-frame-pointer -march=native -maes -mavx -mcrc32
 -mf16c -mfpmath=sse -mfsgsbase -mfxsr
 -minline-all-stringops -mmmx -mpclmul -mpopcnt -msahf
 -msse4.2 -mxsave -mxsaveopt -mvzeroupper -O3 -pipe'
 LDFLAGS=-flto'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS
GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE
M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS LUCID X11
MODULES LIBSYSTEMD LCMS2

Important settings:
  value of $LANG: en_IE.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  ace-window-display-mode: t
  shell-dirtrack-mode: t
  counsel-mode: t
  bug-reference-prog-mode: t
  fic-mode: t
  global-paren-face-mode: t
  paren-face-mode: t
  xterm-mouse-mode: t
  winner-mode: t
  global-whitespace-mode: t
  display-time-mode: t
  global-subword-mode: t
  subword-mode: t
  save-place-mode: t
  show-paren-mode: t
  global-hi-lock-mode: t
  hi-lock-mode: t
  engine-mode: t
  delete-selection-mode: t
  display-battery-mode: t
  override-global-mode: t
  blc-dropbox-mode: t
  blc-rainbow-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  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
  window-divider-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t
  auto-save-visited-mode: t

Features:
(shadow sort footnote face-remap mail-extr gnus-msg gnus-art
mm-uu mml2015 mm-view mml-smime smime dig mailcap gnus-sum
gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source tls gnutls utf7 netrc nnoo parse-time gnus-spec
gnus-int gnus-range gnus-win gnus nnheader emacsbug
eudcb-bbdb bbdb-com crm bbdb bbdb-site timezone eudc
eudc-options-file cus-edit eudc-vars wid-edit message rmc
puny git-annex dired-x dired dired-loaddefs format-spec
rfc822 mml mml-sec epa derived epg gnus-util rmail
rmail-loaddefs xdg mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils ace-window
avy cl-print debug shell pcomplete comint ansi-color
cus-start cus-load colir color counsel jka-compr esh-util
etags xref project swiper ivy flx ivy-overlay ffap thingatpt
server bug-reference fic-mode fill-column-indicator
paren-face elec-pair xt-mouse winner ring disp-table
whitespace time cap-words superword subword saveplace paren
ibuf-macs highlight-escape-sequences hi-lock time-date
engine-mode delsel battery edmacro kmacro cl-extra help-mode
delight advice zenburn-theme browse-url use-package diminish
bind-key finder-inf tex-site info package easymenu
epg-config url-handlers url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs password-cache url-vars
blc-macs blc-lib easy-mmode rx pcase thunk subr-x map seq
byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib
realpath mule-util 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 menu-bar
rfn-eshadow isearch timer select scroll-bar mouse jit-lock
font-lock syntax facemenu font-core term/tty-colors frame
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 minibuffer
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 dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting x-toolkit x
multi-tty make-network-process emacs)

Memory information:
((conses 16 359441 89175)
 (symbols 48 41275 27)
 (miscs 40 1373 2435)
 (strings 32 101726 9595)
 (string-bytes 1 3144509)
 (vectors 16 36288)
 (vector-slots 8 830885 84664)
 (floats 8 420 172)
 (intervals 56 1018 82)
 (buffers 992 17))

Thanks,

-- 
Basil

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Thu, 26 Oct 2017 18:21:02 GMT) Full text and rfc822 format available.

Message #8 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: <28997 <at> debbugs.gnu.org>
Subject: Re: bug#28997: Acknowledgement (27.0.50;
 Error in async shell-command process filter)
Date: Thu, 26 Oct 2017 19:20:34 +0100
I wish to clarify that there is nothing special about the
shell command "ls ~" in my sample recipe; any
output-producing shell command should result in the same
error.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Tue, 31 Oct 2017 10:50:02 GMT) Full text and rfc822 format available.

Message #11 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> users.sourceforge.net>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 28997 <at> debbugs.gnu.org
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Tue, 31 Oct 2017 06:48:52 -0400
"Basil L. Contovounesios" <contovob <at> tcd.ie> writes:

> The first patch replaces the quoted lambda process filter
> with a closure over the name of output-buffer.  By keeping
> track of this name, a lot of the surrounding
> buffer-name-determining code can be simplified via DRY.

This looks good to me.

> The second patch is purely aesthetic and simplifies the cond
> that is touched by my first patch into an equivalent pcase.

I'm not sure about this one.  There was some contention in the past over
use of pcase, with some suggestions even to make an opposite
transformation, e.g., [1].

[1]: https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00055.html




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Tue, 31 Oct 2017 11:31:01 GMT) Full text and rfc822 format available.

Message #14 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28997 <at> debbugs.gnu.org
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Tue, 31 Oct 2017 11:30:27 +0000
"Noam Postavsky" <npostavs <at> users.sourceforge.net> writes:

Thanks for looking into this.

>> The second patch is purely aesthetic and simplifies the cond
>> that is touched by my first patch into an equivalent pcase.
>
> I'm not sure about this one.  There was some contention in the past over
> use of pcase, with some suggestions even to make an opposite
> transformation, e.g., [1].
>
> [1]: https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00055.html

I am not too partial to pcase over cond here.  I would have
exercised more self-restraint and not suggested the refactor
at all, had I not seen several other examples of pcase in
lisp/simple.el.

FWIW, my justification of (not argument for) using pcase
like cl-case, as in my patch, is that it conveys slightly
more information, namely, "I only want to examine this
single expression's value", with slightly less syntax.

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Tue, 31 Oct 2017 11:45:02 GMT) Full text and rfc822 format available.

Message #17 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28997 <at> debbugs.gnu.org
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Tue, 31 Oct 2017 11:44:24 +0000
"Noam Postavsky" <npostavs <at> users.sourceforge.net> writes:

> I'm not sure about this one.  There was some contention in the past over
> use of pcase, with some suggestions even to make an opposite
> transformation, e.g., [1].
>
> [1]: https://lists.gnu.org/archive/html/emacs-devel/2016-01/msg00055.html

Sorry, I sent my last email before reading the whole
thread.  Please disregard my pcase patch and comments.

Thanks,

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Thu, 02 Nov 2017 13:28:02 GMT) Full text and rfc822 format available.

Message #20 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Noam Postavsky <npostavs <at> users.sourceforge.net>
Cc: 28997 <at> debbugs.gnu.org
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Thu, 02 Nov 2017 13:26:49 +0000
Just wondering out of ignorance - would it be desirable to
fix this issue on the emacs-26 branch, or is it of lower
priority?

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Thu, 02 Nov 2017 15:58:01 GMT) Full text and rfc822 format available.

Message #23 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 28997 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Thu, 02 Nov 2017 17:57:31 +0200
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Date: Thu, 02 Nov 2017 13:26:49 +0000
> Cc: 28997 <at> debbugs.gnu.org
> 
> Just wondering out of ignorance - would it be desirable to
> fix this issue on the emacs-26 branch, or is it of lower
> priority?

We try to fix bugs on the release branch, especially bugs in changes
introduced since the last release.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Thu, 02 Nov 2017 23:57:02 GMT) Full text and rfc822 format available.

Message #26 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 28997 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Thu, 02 Nov 2017 23:55:35 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

> We try to fix bugs on the release branch, especially bugs in changes
> introduced since the last release.

This bug was introduced in 85512e7521 "Allow async command
output buffer to be shown only on output", which was first
released with the current pretest 26.0.90.

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Fri, 03 Nov 2017 07:25:02 GMT) Full text and rfc822 format available.

Message #29 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 28997 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Fri, 03 Nov 2017 09:24:05 +0200
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Cc: <npostavs <at> users.sourceforge.net>, <28997 <at> debbugs.gnu.org>
> Date: Thu, 02 Nov 2017 23:55:35 +0000
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > We try to fix bugs on the release branch, especially bugs in changes
> > introduced since the last release.
> 
> This bug was introduced in 85512e7521 "Allow async command
> output buffer to be shown only on output", which was first
> released with the current pretest 26.0.90.

Yes, I know.  And so we will want to fix it on the emacs-26 branch.  I
just tried to answer your question in a more general way than just
about this specific bug.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Fri, 03 Nov 2017 09:53:01 GMT) Full text and rfc822 format available.

Notification sent to "Basil L. Contovounesios" <contovob <at> tcd.ie>:
bug acknowledged by developer. (Fri, 03 Nov 2017 09:53:01 GMT) Full text and rfc822 format available.

Message #34 received at 28997-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: "Basil L. Contovounesios" <contovob <at> tcd.ie>
Cc: 28997-done <at> debbugs.gnu.org
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Fri, 03 Nov 2017 11:52:35 +0200
> From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
> Date: Wed, 25 Oct 2017 16:50:01 +0100
> 
> 1) emacs -Q
> 2) M-x set-variable RET
>    async-shell-command-display-buffer RET
>    nil RET
> 3) M-: (async-shell-command
>         "ls ~" (generate-new-buffer "home")) RET
> 
> This results in the following error:
> 
>   error in process filter: Wrong type argument:
>     stringp, #<buffer home>
> 
> I attach the relevant backtrace.

Thanks, I've pushed your changes to fix this bug, and I'm marking this
bug report as done.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#28997; Package emacs. (Fri, 03 Nov 2017 10:03:02 GMT) Full text and rfc822 format available.

Message #37 received at 28997 <at> debbugs.gnu.org (full text, mbox):

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 28997 <at> debbugs.gnu.org, npostavs <at> users.sourceforge.net
Subject: Re: bug#28997: 27.0.50; Error in async shell-command process filter
Date: Fri, 03 Nov 2017 10:02:20 +0000
Eli Zaretskii <eliz <at> gnu.org> writes:

>> This bug was introduced in 85512e7521 "Allow async command
>> output buffer to be shown only on output", which was first
>> released with the current pretest 26.0.90.
>
> Yes, I know.  And so we will want to fix it on the emacs-26 branch.  I
> just tried to answer your question in a more general way than just
> about this specific bug.

Understood, thank you.

-- 
Basil




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 01 Dec 2017 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.