[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#10674: 24.0.92; cmdproxy.exe fork-bomb

From: Eli Zaretskii
Subject: bug#10674: 24.0.92; cmdproxy.exe fork-bomb
Date: Mon, 06 Feb 2012 19:50:05 +0200

> 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:
  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 = 
  (gdb) p modname
  $3 = 

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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]