GNU bug report logs - #9792
24.0.50; process-file and space in filename

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Wed, 19 Oct 2011 03:46:02 UTC

Severity: normal

Tags: wontfix

Found in version 24.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.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 9792 in the body.
You can then email your comments to 9792 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#9792; Package emacs. (Wed, 19 Oct 2011 03:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Leo <sdl.web <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 19 Oct 2011 03:46:02 GMT) Full text and rfc822 format available.

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

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; process-file and space in filename
Date: Wed, 19 Oct 2011 11:43:53 +0800
To reproduce:

1. M-x cd a directory of git repo which has a master branch
2. Eval: (apply 'process-file "git" nil t nil '("--no-pager" "log"
"--pretty=format:* %H %s" "HEAD..origin/master"))

to get this message:
'c:\Program' is not an internal or external command ...

(executable-find "git") => "c:/Program Files (x86)/Git/cmd/git.cmd"

Tested on GNU Emacs 24.0.50.1 (i386-mingw-nt6.1.7601) of 2011-09-19 on
3249CTO

Sorry the network has been extremely slow sometimes less than 1k/s. So
I haven't been able to test the problem in the pretest version.

Leo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Wed, 19 Oct 2011 07:39:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Leo <sdl.web <at> gmail.com>
Cc: 9792 <at> debbugs.gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Wed, 19 Oct 2011 09:36:49 +0200
> Date: Wed, 19 Oct 2011 11:43:53 +0800
> From: Leo <sdl.web <at> gmail.com>
> 
> To reproduce:
> 
> 1. M-x cd a directory of git repo which has a master branch
> 2. Eval: (apply 'process-file "git" nil t nil '("--no-pager" "log"
> "--pretty=format:* %H %s" "HEAD..origin/master"))
> 
> to get this message:
> 'c:\Program' is not an internal or external command ...
> 
> (executable-find "git") => "c:/Program Files (x86)/Git/cmd/git.cmd"

Please produce a Lisp-level backtrace for this.  I think there's a
call to shell-quote-argument missing somewhere; a backtrace might show
where that is.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Wed, 19 Oct 2011 17:26:01 GMT) Full text and rfc822 format available.

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

From: Leo <sdl.web <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 9792 <at> debbugs.gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Thu, 20 Oct 2011 01:23:38 +0800
On 2011-10-19 15:36 +0800, Eli Zaretskii wrote:
> Please produce a Lisp-level backtrace for this.  I think there's a
> call to shell-quote-argument missing somewhere; a backtrace might show
> where that is.

I don't know how to do that. The message is generated by call-process.

Leo




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Wed, 19 Oct 2011 18:05:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Leo <sdl.web <at> gmail.com>
Cc: 9792 <at> debbugs.gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Wed, 19 Oct 2011 20:02:51 +0200
> From:  Leo <sdl.web <at> gmail.com>
> Cc: 9792 <at> debbugs.gnu.org
> Date: Thu, 20 Oct 2011 01:23:38 +0800
> 
> On 2011-10-19 15:36 +0800, Eli Zaretskii wrote:
> > Please produce a Lisp-level backtrace for this.  I think there's a
> > call to shell-quote-argument missing somewhere; a backtrace might show
> > where that is.
> 
> I don't know how to do that. The message is generated by call-process.

Who calls call-process?

In general, setting a breakpoint in Fcall_process should produce a
Lisp-level backtrace when you type "bt" after the breakpoint breaks,
if you start GDB from the Emacs `src' directory.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Thu, 20 Oct 2011 05:10:01 GMT) Full text and rfc822 format available.

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

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Thu, 20 Oct 2011 13:07:24 +0800
On 2011-10-20 02:02 +0800, Eli Zaretskii wrote:
> Who calls call-process?

`process-file' calls it.

> In general, setting a breakpoint in Fcall_process should produce a
> Lisp-level backtrace when you type "bt" after the breakpoint breaks,
> if you start GDB from the Emacs `src' directory.

In this case I probably won't be able to help much.

Leo





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Thu, 20 Oct 2011 07:14:01 GMT) Full text and rfc822 format available.

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

From: Michael Albinus <michael.albinus <at> gmx.de>
To: Leo <sdl.web <at> gmail.com>
Cc: 9792 <at> debbugs.gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Thu, 20 Oct 2011 09:12:22 +0200
Leo <sdl.web <at> gmail.com> writes:

> On 2011-10-20 02:02 +0800, Eli Zaretskii wrote:
>> Who calls call-process?
>
> `process-file' calls it.
>
>> In general, setting a breakpoint in Fcall_process should produce a
>> Lisp-level backtrace when you type "bt" after the breakpoint breaks,
>> if you start GDB from the Emacs `src' directory.
>
> In this case I probably won't be able to help much.

`process-file' is a Lisp function. It would be sufficient to activate
edebug for it, for example via

M-x load-library RET edebug
M-: (edebug-instrument-function 'process-file)

When the debugger enters `process-file', you can produce the backtrace
with "d".

> Leo

Best regards, Michael.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Thu, 20 Oct 2011 09:16:01 GMT) Full text and rfc822 format available.

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

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Thu, 20 Oct 2011 17:14:02 +0800
On 2011-10-20 15:12 +0800, Michael Albinus wrote:
> `process-file' is a Lisp function. It would be sufficient to activate
> edebug for it, for example via
>
> M-x load-library RET edebug
> M-: (edebug-instrument-function 'process-file)
>
> When the debugger enters `process-file', you can produce the backtrace
> with "d".

This does not enter the debugger. Note when the call-process form is
eval'd in process-file, there is no error from the elisp point of view.
`call-process' returns 1 to indicate failure in executing the external
process.

But I can C-u M-C-x process-file and get a backtrace like this one:
http://paste.pound-python.org/show/13964 if that is helpful.

Leo





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Thu, 20 Oct 2011 10:05:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Leo <sdl.web <at> gmail.com>
Cc: 9792 <at> debbugs.gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Thu, 20 Oct 2011 12:02:48 +0200
> From: Leo <sdl.web <at> gmail.com>
> Date: Thu, 20 Oct 2011 17:14:02 +0800
> 
> On 2011-10-20 15:12 +0800, Michael Albinus wrote:
> > `process-file' is a Lisp function. It would be sufficient to activate
> > edebug for it, for example via
> >
> > M-x load-library RET edebug
> > M-: (edebug-instrument-function 'process-file)
> >
> > When the debugger enters `process-file', you can produce the backtrace
> > with "d".
> 
> This does not enter the debugger.

I think you need to load the .el file that defines process-file, with
"M-x load-file", before you invoke edebug-instrument-function.  In
this case, "M-x load-file RET simple.el RET".

> Note when the call-process form is eval'd in process-file, there is
> no error from the elisp point of view.  `call-process' returns 1 to
> indicate failure in executing the external process.

This doesn't matter.  Instrumenting a Lisp function will enter Edebug
when that function is called, regardless of whether there is a
Lisp-level error.

> But I can C-u M-C-x process-file and get a backtrace like this one:
> http://paste.pound-python.org/show/13964 if that is helpful.

Assuming that process-file is called with the name of the program
being just "git", with no leading directories, it sounds like the
problem is born inside call-process and its subroutines; I will have a
look.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Thu, 20 Oct 2011 11:02:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: sdl.web <at> gmail.com, 9792 <at> debbugs.gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Thu, 20 Oct 2011 13:00:18 +0200
> Date: Thu, 20 Oct 2011 12:02:48 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> Cc: 9792 <at> debbugs.gnu.org
> 
> > But I can C-u M-C-x process-file and get a backtrace like this one:
> > http://paste.pound-python.org/show/13964 if that is helpful.
> 
> Assuming that process-file is called with the name of the program
> being just "git", with no leading directories, it sounds like the
> problem is born inside call-process and its subroutines; I will have a
> look.

The problem happens when both of the following conditions are true:

  . the command being invoked is a batch file (git.cmd in this case)

  . the directory where it lives included parentheses

I cannot find a workable solution for this situation; the error
happens even if the batch file is invoked via the system shell.
Suggestions for solving this are welcome.  The relevant function is
w32proc.c:sys_spawnve.

Unless someone can suggest how to fix this, I'm inclined to tag this
problem as "wontfix", and suggest that Windows users do not install
such commands in a directory whose name includes parentheses.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Fri, 21 Oct 2011 01:30:02 GMT) Full text and rfc822 format available.

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

From: Leo <sdl.web <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Fri, 21 Oct 2011 09:27:29 +0800
On 2011-10-20 19:00 +0800, Eli Zaretskii wrote:
> The problem happens when both of the following conditions are true:
>
>   . the command being invoked is a batch file (git.cmd in this case)
>
>   . the directory where it lives included parentheses

Thanks for looking into this.

But (apply 'process-file "git" nil t nil '("--no-pager" "log")) does not
fail.

Leo





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9792; Package emacs. (Fri, 21 Oct 2011 07:56:01 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Leo <sdl.web <at> gmail.com>
Cc: 9792 <at> debbugs.gnu.org
Subject: Re: bug#9792: 24.0.50; process-file and space in filename
Date: Fri, 21 Oct 2011 09:53:58 +0200
> From: Leo <sdl.web <at> gmail.com>
> Date: Fri, 21 Oct 2011 09:27:29 +0800
> 
> On 2011-10-20 19:00 +0800, Eli Zaretskii wrote:
> > The problem happens when both of the following conditions are true:
> >
> >   . the command being invoked is a batch file (git.cmd in this case)
> >
> >   . the directory where it lives included parentheses
> 
> Thanks for looking into this.
> 
> But (apply 'process-file "git" nil t nil '("--no-pager" "log")) does not
> fail.

Sheer luck.  cmd.exe has all kind of fragile heuristics built into it,
when quotes are present on the command line; sometimes it works,
sometimes it doesn't.

In my testing, I put an ls.cmd in such a directory that called the
real ls.exe, and saw it sometimes work, sometimes not, depending on
what were the command-line arguments.




Added tag(s) wontfix. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Thu, 14 Feb 2013 08:28:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 9792 <at> debbugs.gnu.org and Leo <sdl.web <at> gmail.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Fri, 04 Mar 2016 15:35:22 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 02 Apr 2016 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 9 years and 137 days ago.

Previous Next


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