GNU bug report logs - #76888
31.0.50; start-process: Spawning child process: Invalid argument

Previous Next

Package: emacs;

Reported by: Richard Copley <rcopley <at> gmail.com>

Date: Sun, 9 Mar 2025 12:39:01 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 31.1

Done: Michael Albinus <michael.albinus <at> gmx.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: rcopley <at> gmail.com, michael.albinus <at> gmx.de
Cc: 76888 <at> debbugs.gnu.org
Subject: bug#76888: 31.0.50; start-process: Spawning child process: Invalid argument
Date: Sun, 16 Mar 2025 10:21:13 +0200
> Cc: 76888 <at> debbugs.gnu.org
> Date: Sat, 15 Mar 2025 13:48:10 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>

Trying this recipe, I have some questions and observations.

> > From: Richard Copley <rcopley <at> gmail.com>
> > Date: Sun, 9 Mar 2025 12:37:56 +0000
> > 
> > When the "*Async Shell Command*" buffer is re-used, its
> > connection-local variable 'shell-file-name' is set permanently instead
> > of temporarily, and if the value is inappropriate, an error ensues.

I'm not sure this is relevant, see below.  Or if it _is_ relevant, I
don't think I understand why the value of shell-file-name in the
"*Async Shell Command*" buffer matters.

> > Recipe from 'emacs -Q', on Windows:
> > 
> > Visit a remote file on a Linux system using tramp. (You will need to
> > substitute an appropriate remote file name here.)
> > 
> > [C-x C-f] /plink:xxx:/ [RET]

This shows the remote file on display.

> > Execute an asynchronous shell command.
> > 
> > [M-&] echo [RET]

This command should run on the remote host, because the
default-directory is remote, due to the current-buffer visiting a
remote file, per the above "C-x C-f" command.

Is that what you see?  Does the "echo" command run on the remote host?

> > NOTE: (with-current-buffer "*Async Shell Command*" shell-file-name)
> > returns the path to "cmdproxy.exe" as expected.
> > 
> > Execute an asynchronous shell command again.
> > 
> > [M-&] echo [RET]
> > 
> > NOTE: (with-current-buffer "*Async Shell Command*" shell-file-name)
> > now returns "/bin/sh".
> > 
> > Visit a local file.
> > 
> > [C-x C-f C-a C-k] C:/ [RET]

Now the local file is shown in the selected window, and the current
buffer visits that file, so its default-directory is local.

> > Execute an async shell command.
> > 
> > [M-&] echo [RET]

This command should run locally, because default-directory is local.
Is that what you see?

> > An error is signalled, with the message "start-process: Spawning child
> > process: Invalid argument". (Note, the invalid argument is the
> > executable name, "/bin/sh").

In my case, the error message dosn't pop up each time, but I do see it
from time to time.

Michael, does Tramp reuse the value of shell-file-name between shell
commands, and if so, how does it know whether to reuse or not?




This bug report was last modified 55 days ago.

Previous Next


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