* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
@ 2012-01-31 3:12 sjm
2012-02-02 17:27 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: sjm @ 2012-01-31 3:12 UTC (permalink / raw)
To: 10674
How to fork-bomb Windows in 4 simple steps:
1. M-x customize-browse
2. Click "Programming"
3. Click "Languages"
4. Wait
Your process list should quickly get flooded with copies of cmdproxy.exe
and Windows should soon grind to a halt.
In GNU Emacs 24.0.92.1 (i386-mingw-nt6.1.7601)
of 2012-01-23 on MARVIN
Windowing system distributor `Microsoft Corp.', version 6.1.7601
configured using `configure --with-gcc (4.6) --no-opt --cflags -ID:/devel/emacs/libs/libXpm-3.5.8/include -ID:/devel/emacs/libs/libXpm-3.5.8/src -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include -ID:/devel/emacs/libs/giflib-4.1.4-1/include -ID:/devel/emacs/libs/jpeg-6b-4/include -ID:/devel/emacs/libs/tiff-3.8.2-1/include -ID:/devel/emacs/libs/gnutls-3.0.9/include --ldflags -LD:/devel/emacs/libs/gnutls-3.0.9/lib'
Important settings:
value of $LC_ALL: nil
value of $LC_COLLATE: nil
value of $LC_CTYPE: nil
value of $LC_MESSAGES: nil
value of $LC_MONETARY: nil
value of $LC_NUMERIC: nil
value of $LC_TIME: nil
value of $LANG: ENG
value of $XMODIFIERS: nil
locale-coding-system: cp1252
default enable-multibyte-characters: t
Major mode: Fundamental
Minor modes in effect:
tooltip-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Recent input:
M-x e m a c s - b u g <tab> <backspace> <backspace>
<backspace> r e p o <tab> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> r e p o <tab> r <tab> <ret
urn>
Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Making completion list...
Load-path shadows:
None found.
Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug help-mode easymenu view time-date tooltip ediff-hook vc-hooks
lisp-float-type mwheel dos-w32 disp-table ls-lisp w32-win w32-vars
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer button faces cus-face files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
multi-tty emacs)
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-01-31 3:12 bug#10674: 24.0.92; cmdproxy.exe fork-bomb sjm
@ 2012-02-02 17:27 ` Eli Zaretskii
[not found] ` <4F2B5793.2010809@spamcop.net>
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-02 17:27 UTC (permalink / raw)
To: sjm; +Cc: 10674
> From: sjm@spamcop.net
> Date: Tue, 31 Jan 2012 03:12:37 +0000
>
> How to fork-bomb Windows in 4 simple steps:
>
> 1. M-x customize-browse
> 2. Click "Programming"
> 3. Click "Languages"
> 4. Wait
>
> Your process list should quickly get flooded with copies of cmdproxy.exe
> and Windows should soon grind to a halt.
I cannot reproduce this, no matter how hard I try. I tried half a
dozen of different Emacs binaries, including the very same you used:
> In GNU Emacs 24.0.92.1 (i386-mingw-nt6.1.7601)
> of 2012-01-23 on MARVIN
which is the latest weekly snapshot of the development trunk, and also
several others. I did that on 2 different machines. None of these
flooded my system with copies of cmdproxy. They all worked as
expected, showing the list of programming languages supported by Emacs
modes.
So something else is at work here that exists on your machine, but not
on mine. One difference is that my machines run Windows XP, not
Windows 7. But I don't think this is the first thing I'd suspect.
First, does this happen in "emacs -Q" for you? If not, please look in
your .emacs for possible reasons.
If "emacs -Q" produces the problem, then the only invocation of
cmdproxy in the sequence you describe is in python.el, in the function
python-check-version, which invokes "python -V" and parses its
output. Do you have Python installed, and if so, is python.exe on
your PATH? Also, does the following command works as expected, or
does it also produce the same problem?
M-: (shell-command-to-string "python -V") RET
Finally, please make sure Emacs picks up the correct binary of
cmdproxy.exe, the correct binary of python.exe (if it is installed),
and your python.elc is not corrupted (recompile it to be sure, or
manually load python.el before doing the sequence that triggered the
bug).
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
[not found] ` <4F2B5793.2010809@spamcop.net>
@ 2012-02-03 10:47 ` Eli Zaretskii
2012-02-05 22:50 ` Simon Morgan
2012-02-06 15:29 ` Simon Morgan
0 siblings, 2 replies; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-03 10:47 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
[Please keep the bug tracker on the CC list, so this whole discussion
is archived in the bug database. Thanks in advance.]
> Date: Fri, 03 Feb 2012 03:42:11 +0000
> From: Simon Morgan <sjm@spamcop.net>
>
> It turns out that if I simply run cmdproxy.exe on its own it starts
> forking like crazy, so it looks like the problem is in cmdproxy.exe.
Please see if all of the copies of cmdproxy are children of the same
progeny, i.e. the second one is the child of the first one and the
parent of the third one, etc. (You could use Process Explorer to see
the processes as a tree.)
If indeed cmdproxy spawns itself endlessly, then the first suspect is
this code in cmdproxy.c:
if (!SearchPath (NULL, argv[0], ".exe", sizeof (path), path, &progname)
|| !GetShortPathName (path, path, sizeof (path))
|| stricmp (modname, path) != 0)
{
/* We are being used as a helper to run a DOS app; just pass
command line to DOS app without change. */
/* TODO: fill in progname. */
if (spawn (NULL, GetCommandLine (), dir, &rc))
return rc;
fail ("Could not run %s\n", GetCommandLine ());
}
Are you able to run cmdproxy under a debugger and see what is going on
here? If so, please tell what are argv[0], path, and modname just
before the call to `spawn' (assuming my guess is correct, and cmdproxy
really calls `spawn' in this snippet).
If you cannot run cmdproxy under a debugger, please tell:
. how exactly did you invoke cmdproxy from the command line to get
the infinite spawning problem?
. do you have other copies of cmdproxy.exe somewhere on your Path?
. is this Windows 7 box a 32-bit or a 64-bit system?
. what is the value of the following Registry key?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SafeProcessSearchMode
Thanks.
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-03 10:47 ` Eli Zaretskii
@ 2012-02-05 22:50 ` Simon Morgan
2012-02-06 3:57 ` Eli Zaretskii
2012-02-06 15:29 ` Simon Morgan
1 sibling, 1 reply; 24+ messages in thread
From: Simon Morgan @ 2012-02-05 22:50 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 1063 bytes --]
On 03/02/2012 10:47 AM, Eli Zaretskii wrote:
> Please see if ... the second one is the child of the first one and
> the parent of the third one, etc.
This is the case.
> Are you able to run cmdproxy under a debugger and see what is going on
> here?
Not currently.
> If you cannot run cmdproxy under a debugger, please tell:
>
> . how exactly did you invoke cmdproxy from the command line to get
> the infinite spawning problem?
Just by executing "cmdproxy.exe" while in "C:\emacs-24.0.92\bin".
> . do you have other copies of cmdproxy.exe somewhere on your Path?
Nope:
C:\Users\Simon>where cmdproxy
INFO: Could not find files for the given pattern(s).
> . is this Windows 7 box a 32-bit or a 64-bit system?
64-bit.
> . what is the value of the following Registry key?
>
> HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SafeProcessSearchMode
It doesn't exist.
--
The fundamental asymmetry of consciousness means triangulation is the
only path to understanding.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-05 22:50 ` Simon Morgan
@ 2012-02-06 3:57 ` Eli Zaretskii
2012-02-06 12:53 ` Simon Morgan
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-06 3:57 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
> Date: Sun, 05 Feb 2012 22:50:10 +0000
> From: Simon Morgan <sjm@spamcop.net>
> CC: 10674@debbugs.gnu.org
>
> On 03/02/2012 10:47 AM, Eli Zaretskii wrote:
> > Please see if ... the second one is the child of the first one and
> > the parent of the third one, etc.
>
> This is the case.
>
> > Are you able to run cmdproxy under a debugger and see what is going on
> > here?
>
> Not currently.
>
> > If you cannot run cmdproxy under a debugger, please tell:
> >
> > . how exactly did you invoke cmdproxy from the command line to get
> > the infinite spawning problem?
>
> Just by executing "cmdproxy.exe" while in "C:\emacs-24.0.92\bin".
>
> > . do you have other copies of cmdproxy.exe somewhere on your Path?
>
> Nope:
>
> C:\Users\Simon>where cmdproxy
> INFO: Could not find files for the given pattern(s).
>
> > . is this Windows 7 box a 32-bit or a 64-bit system?
>
> 64-bit.
>
> > . what is the value of the following Registry key?
> >
> > HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SafeProcessSearchMode
>
> It doesn't exist.
Then I'm out of ideas. Unless someone can run cmdproxy under a
debugger on a system where this problem exists, I don't know how to
fix this problem.
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-06 3:57 ` Eli Zaretskii
@ 2012-02-06 12:53 ` Simon Morgan
0 siblings, 0 replies; 24+ messages in thread
From: Simon Morgan @ 2012-02-06 12:53 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 433 bytes --]
On 06/02/2012 03:57 AM, Eli Zaretskii wrote:
> Then I'm out of ideas. Unless someone can run cmdproxy under a
> debugger on a system where this problem exists, I don't know how to
> fix this problem.
Can you recommend a debugger? Would I need a build with debugging
symbols? Would this entail building it myself?
--
The fundamental asymmetry of consciousness means triangulation is the
only path to understanding.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-03 10:47 ` Eli Zaretskii
2012-02-05 22:50 ` Simon Morgan
@ 2012-02-06 15:29 ` Simon Morgan
2012-02-06 15:47 ` Juanma Barranquero
2012-02-06 17:50 ` Eli Zaretskii
1 sibling, 2 replies; 24+ messages in thread
From: Simon Morgan @ 2012-02-06 15:29 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 1282 bytes --]
On 03/02/2012 10:47 AM, Eli Zaretskii wrote:
> If indeed cmdproxy spawns itself endlessly, then the first suspect is
> this code in cmdproxy.c:
>
> if (!SearchPath (NULL, argv[0], ".exe", sizeof (path), path,&progname)
> || !GetShortPathName (path, path, sizeof (path))
> || stricmp (modname, path) != 0)
> {
> /* We are being used as a helper to run a DOS app; just pass
> command line to DOS app without change. */
> /* TODO: fill in progname. */
> if (spawn (NULL, GetCommandLine (), dir,&rc))
> return rc;
> fail ("Could not run %s\n", GetCommandLine ());
> }
>
> Are you able to run cmdproxy under a debugger and see what is going on
> here? If so, please tell what are argv[0], path, and modname just
> before the call to `spawn' (assuming my guess is correct, and cmdproxy
> really calls `spawn' in this snippet).
Okay so I managed to get cmdproxy running under gdb without much trouble
so here is what you asked for:
http://pastie.org/3327496
I've also discovered that cmdproxy only seems to do the whole infinite
respawn thing if I run it in the emacs bin directory.
--
The fundamental asymmetry of consciousness means triangulation is the
only path to understanding.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-06 15:29 ` Simon Morgan
@ 2012-02-06 15:47 ` Juanma Barranquero
2012-02-06 16:57 ` Simon Morgan
2012-02-06 17:50 ` Eli Zaretskii
1 sibling, 1 reply; 24+ messages in thread
From: Juanma Barranquero @ 2012-02-06 15:47 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
On Mon, Feb 6, 2012 at 16:29, Simon Morgan <sjm@spamcop.net> wrote:
> I've also discovered that cmdproxy only seems to do the whole infinite
> respawn thing if I run it in the emacs bin directory.
Shoots in the dark:
- Do you have any .cmd or .bat in that directory?
- What's the value of your COMSPEC env var?
Perhaps that will shed some light.
Juanma
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-06 15:47 ` Juanma Barranquero
@ 2012-02-06 16:57 ` Simon Morgan
0 siblings, 0 replies; 24+ messages in thread
From: Simon Morgan @ 2012-02-06 16:57 UTC (permalink / raw)
To: Juanma Barranquero; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 384 bytes --]
On 06/02/2012 03:47 PM, Juanma Barranquero wrote:
> - Do you have any .cmd or .bat in that directory?
Nope. Just the stuff that's distributed with emacs.
> - What's the value of your COMSPEC env var?
C:\Users\Simon>echo %COMSPEC%
C:\Windows\system32\cmd.exe
--
The fundamental asymmetry of consciousness means triangulation is the
only path to understanding.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-06 15:29 ` Simon Morgan
2012-02-06 15:47 ` Juanma Barranquero
@ 2012-02-06 17:50 ` Eli Zaretskii
2012-02-06 18:00 ` Simon Morgan
1 sibling, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-06 17:50 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
> Date: Mon, 06 Feb 2012 15:29:37 +0000
> From: Simon Morgan <sjm@spamcop.net>
> CC: 10674@debbugs.gnu.org
>
> > If indeed cmdproxy spawns itself endlessly, then the first suspect is
> > this code in cmdproxy.c:
> >
> > if (!SearchPath (NULL, argv[0], ".exe", sizeof (path), path,&progname)
> > || !GetShortPathName (path, path, sizeof (path))
> > || stricmp (modname, path) != 0)
> > {
> > /* We are being used as a helper to run a DOS app; just pass
> > command line to DOS app without change. */
> > /* TODO: fill in progname. */
> > if (spawn (NULL, GetCommandLine (), dir,&rc))
> > return rc;
> > fail ("Could not run %s\n", GetCommandLine ());
> > }
> >
> > Are you able to run cmdproxy under a debugger and see what is going on
> > here? If so, please tell what are argv[0], path, and modname just
> > before the call to `spawn' (assuming my guess is correct, and cmdproxy
> > really calls `spawn' in this snippet).
>
> Okay so I managed to get cmdproxy running under gdb without much trouble
> so here is what you asked for:
>
> http://pastie.org/3327496
Thanks. For the record, I reproduce that here:
C:\emacs-24.0.92\bin>gdb cmdproxy.exe
GNU gdb (GDB) 7.3.1
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from c:\emacs-24.0.92\bin\cmdproxy.exe...done.
(gdb) break 565
Breakpoint 1 at 0x401f3f: file cmdproxy.c, line 565.
(gdb) r
Starting program: c:\emacs-24.0.92\bin\cmdproxy.exe
[New Thread 4636.0x11e0]
Breakpoint 1, main (argc=1, argv=0x5e2c18) at cmdproxy.c:565
565 if (spawn (NULL, GetCommandLine (), dir, &rc))
(gdb) p argv[0]
$1 = 0x5e2b51 "c:\\emacs-24.0.92\\bin\\cmdproxy.exe"
(gdb) p path
$2 = "c:\\emacs-24.0.92\\bin\\cmdproxy.exe\000\000\000\000\000\000\000c\001\000\001\000\000\000\000\177\000\000\000ÕV\000\000\060ü(\000@Wpwhý(\000\064ý(\000v\arw\000\000\210\000\000\000\000\000\000\000\210\000ð‡\210\000ʸgwð‡\210\000\000\000\210\000\000\000\210\000ʸgwð‡\210\000xý(\000 \027rw8\001\210\000\004\027rwÿ\003ew\000\000\210\000\000\000\210\000\000\000\000\000\000\000\210\000\000\000^\000\000\000\001\001Dý(\000\000\000^\000\\þ(\000Õqlw\027.*\000þÿÿÿ\004\027rwš«mw\000\000\210\000c\000\000P"...
(gdb) p modname
$3 = "c:\\emacs-24.0.92\\bin\\cmdproxy.exe\000^\000\000\000^\000¨\016^\000¨\016^\000\001\000\000\000\000\000^\000@þ(\000í\033rw8\001^\000Ñ\033rwÇ\000ew\000\000\000\000\000\000^\000¨\016^\000þÿÿÿ\200\000\000\000ú›m\001\fþ(\000a\000\000P\230þ(\000Õqlw·/*\000þÿÿÿÑ\033rwú›mw\000\000^\000a\000\000P¨\016^\000¨\016^\000¨þ(\000\200ôÊv\000\000^\000\000\000\000\000‰ôÊv–¨•\003\004\000\000\000¬\016^\000¨\016^\000Êúfw\"\020iwÿÿÿÿ$\000\000\000"...
(gdb)
It sounds like SearchPath fails. Does it help to add
c:\emacs-24.0.92\bin to your Path?
> I've also discovered that cmdproxy only seems to do the whole infinite
> respawn thing if I run it in the emacs bin directory.
But then how come it happens for you in customize-browse? Did you
invoke Emacs in the emacs bin directory? If so, what happens if you
invoke it from a different directory?
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-06 17:50 ` Eli Zaretskii
@ 2012-02-06 18:00 ` Simon Morgan
2012-02-06 21:26 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Simon Morgan @ 2012-02-06 18:00 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
On 06/02/2012 05:50 PM, Eli Zaretskii wrote:
> It sounds like SearchPath fails. Does it help to add
> c:\emacs-24.0.92\bin to your Path?
Nope.
> But then how come it happens for you in customize-browse? Did you
> invoke Emacs in the emacs bin directory?
Yeah, I typically either double-click on runemacs.exe while in that
directory or run it from a desktop shortcut which has "Start in" set to
that directory.
> If so, what happens if you invoke it from a different directory?
Same problem. cmdproxy.exe only behaves if I copy it to another
directory and run it from there.
--
The fundamental asymmetry of consciousness means triangulation is the
only path to understanding.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-06 18:00 ` Simon Morgan
@ 2012-02-06 21:26 ` Eli Zaretskii
2012-02-06 22:22 ` Simon Morgan
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-06 21:26 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 822 bytes --]
> Date: Mon, 06 Feb 2012 18:00:17 +0000
> From: Simon Morgan <sjm@spamcop.net>
> CC: 10674@debbugs.gnu.org
>
> On 06/02/2012 05:50 PM, Eli Zaretskii wrote:
> > It sounds like SearchPath fails. Does it help to add
> > c:\emacs-24.0.92\bin to your Path?
>
> Nope.
I modified cmdproxy.c to pinpoint which of the 3 tests leading to the
recursive spawn fails, and also to report the error code explaining
the failure. Attached please find the modified source and the
compiled executable. After unzipping them in emacs's bin directory,
please start GDB ("gdb cmdproxy.exe"), type "dir ." (to let it pick up
the modified source), then run cmdproxy till the line where it calls
spawn, and see what the values of i, j, k tell you about which test
failed, and what the value of err says about the reason of the
failure.
TIA
[-- Attachment #2: cmdproxy.zip --]
[-- Type: application/zip, Size: 148363 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-06 21:26 ` Eli Zaretskii
@ 2012-02-06 22:22 ` Simon Morgan
2012-02-07 3:54 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Simon Morgan @ 2012-02-06 22:22 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 820 bytes --]
On 06/02/2012 09:26 PM, Eli Zaretskii wrote:
> I modified cmdproxy.c to pinpoint which of the 3 tests leading to the
> recursive spawn fails, and also to report the error code explaining
> the failure. Attached please find the modified source and the
> compiled executable. After unzipping them in emacs's bin directory,
> please start GDB ("gdb cmdproxy.exe"), type "dir ." (to let it pick up
> the modified source), then run cmdproxy till the line where it calls
> spawn, and see what the values of i, j, k tell you about which test
> failed, and what the value of err says about the reason of the
> failure.
(gdb) p i
$1 = 33
(gdb) p j
$2 = 0
(gdb) p k
$3 = 0
(gdb) p err
$4 = 4885256
--
The fundamental asymmetry of consciousness means triangulation is the
only path to understanding.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-06 22:22 ` Simon Morgan
@ 2012-02-07 3:54 ` Eli Zaretskii
2012-02-07 13:25 ` Simon Morgan
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-07 3:54 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
> Date: Mon, 06 Feb 2012 22:22:22 +0000
> From: Simon Morgan <sjm@spamcop.net>
> CC: 10674@debbugs.gnu.org
>
> (gdb) p i
> $1 = 33
> (gdb) p j
> $2 = 0
> (gdb) p k
> $3 = 0
> (gdb) p err
> $4 = 4885256
This means GetShortPathName fails, and the error code doesn't make any
sense. Are you sure you stopped _after_ this line:
DWORD err = GetLastError ();
?
Anyway, if GetShortPathName fails, I will try to come up with a fix
that works at least when path and module are either both short or both
long file names.
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-07 3:54 ` Eli Zaretskii
@ 2012-02-07 13:25 ` Simon Morgan
2012-02-07 17:14 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Simon Morgan @ 2012-02-07 13:25 UTC (permalink / raw)
To: 10674
[-- Attachment #1: Type: text/plain, Size: 586 bytes --]
On 07/02/2012 03:54 AM, Eli Zaretskii wrote:
> This means GetShortPathName fails, and the error code doesn't make any
> sense. Are you sure you stopped _after_ this line:
>
> DWORD err = GetLastError ();
>
> ?
Sorry about that:
Breakpoint 1, main (argc=1, argv=0x9f2c00) at cmdproxy.c:566
566 DWORD err = GetLastError ();
(gdb) n
567 if (spawn (NULL, GetCommandLine (), dir, &rc))
(gdb) p err
$1 = 5
--
The fundamental asymmetry of consciousness means triangulation is the
only path to understanding.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-07 13:25 ` Simon Morgan
@ 2012-02-07 17:14 ` Eli Zaretskii
2012-02-07 18:31 ` Simon Morgan
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-07 17:14 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
> Date: Tue, 07 Feb 2012 13:25:48 +0000
> From: Simon Morgan <sjm@spamcop.net>
>
> Breakpoint 1, main (argc=1, argv=0x9f2c00) at cmdproxy.c:566
> 566 DWORD err = GetLastError ();
> (gdb) n
> 567 if (spawn (NULL, GetCommandLine (), dir, &rc))
> (gdb) p err
> $1 = 5
That's "Access denied". The question is, why?
You said that copying cmdproxy.exe into a different directory made the
problem go away -- can you try to figure out what is it in this
particular directory that triggers the problem? Is it the fact that
there are other executable files there? the particular location of the
directory in the directory tree hierarchy relative to the drive root?
or maybe the fact that there are sibling directories from the Emacs
distro? or does the directory have some special access rights (e.g.,
you unzipped the archive as a privileged user)? If you unzip the
distribution again in another place, does the problem happen there as
well?
Btw, did you run addpm after unzipping the archive? And which unzip
program did you use?
(I can program around "Access denied", but I'd like to try to
understand the cause before that.)
TIA
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-07 17:14 ` Eli Zaretskii
@ 2012-02-07 18:31 ` Simon Morgan
2012-02-07 18:45 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Simon Morgan @ 2012-02-07 18:31 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]
On 07/02/2012 05:14 PM, Eli Zaretskii wrote:
> You said that copying cmdproxy.exe into a different directory made the
> problem go away -- can you try to figure out what is it in this
> particular directory that triggers the problem? Is it the fact that
> there are other executable files there? the particular location of the
> directory in the directory tree hierarchy relative to the drive root?
> or maybe the fact that there are sibling directories from the Emacs
> distro? or does the directory have some special access rights (e.g.,
> you unzipped the archive as a privileged user)? If you unzip the
> distribution again in another place, does the problem happen there as
> well?
>
> Btw, did you run addpm after unzipping the archive? And which unzip
> program did you use?
>
> (I can program around "Access denied", but I'd like to try to
> understand the cause before that.)
Pretty sure it's a permissions thing. When I unzip the emacs
distribution to my desktop and run it from there, cmdproxy doesn't
infinitely respawn and customize-browse works as it should.
--
The fundamental asymmetry of consciousness means triangulation is the
only path to understanding.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-07 18:31 ` Simon Morgan
@ 2012-02-07 18:45 ` Eli Zaretskii
2012-02-11 12:08 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-07 18:45 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
> Date: Tue, 07 Feb 2012 18:31:43 +0000
> From: Simon Morgan <sjm@spamcop.net>
> CC: 10674@debbugs.gnu.org
>
> > (I can program around "Access denied", but I'd like to try to
> > understand the cause before that.)
>
> Pretty sure it's a permissions thing. When I unzip the emacs
> distribution to my desktop and run it from there, cmdproxy doesn't
> infinitely respawn and customize-browse works as it should.
OK. I guess there are some permission problems with C:\ or something.
I will come up with some work-around.
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-07 18:45 ` Eli Zaretskii
@ 2012-02-11 12:08 ` Eli Zaretskii
2012-02-13 19:25 ` Simon Morgan
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-11 12:08 UTC (permalink / raw)
To: sjm; +Cc: 10674
> Date: Tue, 07 Feb 2012 20:45:35 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 10674@debbugs.gnu.org
>
> > Date: Tue, 07 Feb 2012 18:31:43 +0000
> > From: Simon Morgan <sjm@spamcop.net>
> > CC: 10674@debbugs.gnu.org
> >
> > > (I can program around "Access denied", but I'd like to try to
> > > understand the cause before that.)
> >
> > Pretty sure it's a permissions thing. When I unzip the emacs
> > distribution to my desktop and run it from there, cmdproxy doesn't
> > infinitely respawn and customize-browse works as it should.
>
> OK. I guess there are some permission problems with C:\ or something.
>
> I will come up with some work-around.
A fixed trial version was sent off-list.
Simon, please tell here if it fixes the problem, and I will then
commit the changes to the development repo.
TIA
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-11 12:08 ` Eli Zaretskii
@ 2012-02-13 19:25 ` Simon Morgan
2012-02-13 20:46 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Simon Morgan @ 2012-02-13 19:25 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 616 bytes --]
On 11/02/2012 12:08 PM, Eli Zaretskii wrote:
> A fixed trial version was sent off-list.
>
> Simon, please tell here if it fixes the problem, and I will then
> commit the changes to the development repo.
No, it doesn't. If I copy it to a directory by itself in the root of C
then it doesn't fork-bomb when I run cmdproxy directly, but if I copy it
to my emacs bin directory and do customize-browse, it still goes mental.
--
The tortoise lays on its back, its belly baking in the hot sun, beating
its legs, trying to turn itself over but it can't. Not without your
help. But you're not helping.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-13 19:25 ` Simon Morgan
@ 2012-02-13 20:46 ` Eli Zaretskii
2012-02-19 19:07 ` Simon Morgan
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-13 20:46 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
> Date: Mon, 13 Feb 2012 19:25:15 +0000
> From: Simon Morgan <sjm@spamcop.net>
> CC: 10674@debbugs.gnu.org
>
> > Simon, please tell here if it fixes the problem, and I will then
> > commit the changes to the development repo.
>
> No, it doesn't. If I copy it to a directory by itself in the root of C
> then it doesn't fork-bomb when I run cmdproxy directly, but if I copy it
> to my emacs bin directory and do customize-browse, it still goes mental.
Then please step with a debugger starting at line 555 of cmdproxy.c,
print the values of the variables involved there, and tell me what I
missed.
Thanks.
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-13 20:46 ` Eli Zaretskii
@ 2012-02-19 19:07 ` Simon Morgan
2012-02-19 21:16 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Simon Morgan @ 2012-02-19 19:07 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: 10674
[-- Attachment #1: Type: text/plain, Size: 538 bytes --]
On 13/02/2012 08:46 PM, Eli Zaretskii wrote:
> Then please step with a debugger starting at line 555 of cmdproxy.c,
> print the values of the variables involved there, and tell me what I
> missed.
It seems to be working now. It's quite possible I messed up before and
was extracting the fix to the wrong directory or something stupid like that.
--
The tortoise lays on its back, its belly baking in the hot sun, beating
its legs, trying to turn itself over but it can't. Not without your
help. But you're not helping.
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4783 bytes --]
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-19 19:07 ` Simon Morgan
@ 2012-02-19 21:16 ` Eli Zaretskii
2012-02-24 10:15 ` Eli Zaretskii
0 siblings, 1 reply; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-19 21:16 UTC (permalink / raw)
To: Simon Morgan; +Cc: 10674
> Date: Sun, 19 Feb 2012 19:07:57 +0000
> From: Simon Morgan <sjm@spamcop.net>
> CC: 10674@debbugs.gnu.org
>
> On 13/02/2012 08:46 PM, Eli Zaretskii wrote:
> > Then please step with a debugger starting at line 555 of cmdproxy.c,
> > print the values of the variables involved there, and tell me what I
> > missed.
>
> It seems to be working now.
Thanks, that's great news. I will commit those changes in a day or
two.
Thanks again for your help in debugging this problem.
^ permalink raw reply [flat|nested] 24+ messages in thread
* bug#10674: 24.0.92; cmdproxy.exe fork-bomb
2012-02-19 21:16 ` Eli Zaretskii
@ 2012-02-24 10:15 ` Eli Zaretskii
0 siblings, 0 replies; 24+ messages in thread
From: Eli Zaretskii @ 2012-02-24 10:15 UTC (permalink / raw)
To: sjm; +Cc: 10674-done
> Date: Sun, 19 Feb 2012 23:16:46 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 10674@debbugs.gnu.org
>
> > Date: Sun, 19 Feb 2012 19:07:57 +0000
> > From: Simon Morgan <sjm@spamcop.net>
> > CC: 10674@debbugs.gnu.org
> >
> > On 13/02/2012 08:46 PM, Eli Zaretskii wrote:
> > > Then please step with a debugger starting at line 555 of cmdproxy.c,
> > > print the values of the variables involved there, and tell me what I
> > > missed.
> >
> > It seems to be working now.
>
> Thanks, that's great news. I will commit those changes in a day or
> two.
Done (revision 107405 on the trunk).
^ permalink raw reply [flat|nested] 24+ messages in thread
end of thread, other threads:[~2012-02-24 10:15 UTC | newest]
Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-31 3:12 bug#10674: 24.0.92; cmdproxy.exe fork-bomb sjm
2012-02-02 17:27 ` Eli Zaretskii
[not found] ` <4F2B5793.2010809@spamcop.net>
2012-02-03 10:47 ` Eli Zaretskii
2012-02-05 22:50 ` Simon Morgan
2012-02-06 3:57 ` Eli Zaretskii
2012-02-06 12:53 ` Simon Morgan
2012-02-06 15:29 ` Simon Morgan
2012-02-06 15:47 ` Juanma Barranquero
2012-02-06 16:57 ` Simon Morgan
2012-02-06 17:50 ` Eli Zaretskii
2012-02-06 18:00 ` Simon Morgan
2012-02-06 21:26 ` Eli Zaretskii
2012-02-06 22:22 ` Simon Morgan
2012-02-07 3:54 ` Eli Zaretskii
2012-02-07 13:25 ` Simon Morgan
2012-02-07 17:14 ` Eli Zaretskii
2012-02-07 18:31 ` Simon Morgan
2012-02-07 18:45 ` Eli Zaretskii
2012-02-11 12:08 ` Eli Zaretskii
2012-02-13 19:25 ` Simon Morgan
2012-02-13 20:46 ` Eli Zaretskii
2012-02-19 19:07 ` Simon Morgan
2012-02-19 21:16 ` Eli Zaretskii
2012-02-24 10:15 ` Eli Zaretskii
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).