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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 03 Feb 2012 12:47:26 +0200

[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 <[email-masked]>
> 
> 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.