CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    [RESOLVED] Can't kill my process to rebuild the app

    I've got a Visual Studio project which builds a program in Debug mode, say Program.exe.

    Apparently after one of my recent runs, Windows got it into its head that Program.exe was still running even after I closed it. Now it won't let me build the latest code changes since it won't overwrite the executable.

    I tried the task manager first, of course. "End Process" did absolutely nothing----it asks its "are you sure" bit, I click yes, and the process is still there.

    After some Googling I downloaded a utility called pskill which is supposed to deal with these situations, but it didn't manage to accomplish anything either.

    Restarting is not an option at present because I've got a Linux terminal open with another program running there, and I don't want to interrupt it.

    Any suggestions? I know I can change the built program name, but I don't really want to do that either for various reasons.

  2. #2
    Join Date
    Sep 2005
    Location
    London
    Posts
    208

    Re: Can't kill my process to rebuild the app

    Hi Lindley,

    Try using SystemInternal process explorer (now part of Microsoft)
    http://technet.microsoft.com/en-us/s...s/bb896653.asp

    With ProcessXP when you zoom in on a particular process you can see who is using it.
    I believe that you should be able to 'kill' the process using this utility.


    Hope it helps
    Doron
    Last edited by Doron Moraz; June 17th, 2009 at 06:11 PM. Reason: http://

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Can't kill my process to rebuild the app

    The link doesn't work. Also, since pskill comes from the SysInternal group, I'm not really optimistic about something else of theirs faring any better.

  4. #4
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Can't kill my process to rebuild the app

    It's probably the Linux running messing things up. :-)

    It could be that one of the associated build processes are interfering. Make sure they are all closed and then retry taskmgr (using the process list tab, not the application tab).

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Can't kill my process to rebuild the app

    Quote Originally Posted by Arjay View Post
    It's probably the Linux running messing things up. :-)

    It could be that one of the associated build processes are interfering. Make sure they are all closed and then retry taskmgr (using the process list tab, not the application tab).
    Btw, all those programs use TerminateProcess under the covers - so if task manager doesn't do it...

  6. #6
    Join Date
    Jun 2009
    Posts
    4

    Re: Can't kill my process to rebuild the app

    i had the same issues... did u use ntqueryobjects or any similar function?
    local or remote linux terminal?

  7. #7
    Join Date
    Sep 2005
    Location
    London
    Posts
    208

    Re: Can't kill my process to rebuild the app

    Quote Originally Posted by Lindley View Post
    The link doesn't work.
    Ooops: http://technet.microsoft.com/en-us/s.../bb896653.aspx

    Quote Originally Posted by Lindley View Post
    Also, since pskill comes from the SysInternal group, I'm not really optimistic about something else of theirs faring any better.
    Regardless to the process killing, ProcessXP will allow you to see who is using program.exe....


    Reagrds
    Doron

  8. #8
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Can't kill my process to rebuild the app

    If the process is attached to a debugger, task-manager may not end the process.
    Have you put code that self-starts itself, using some other process?
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  9. #9
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Can't kill my process to rebuild the app

    The Linux terminal is just a Putty session to a remote machine. It's not involved in the problem, it's just the reason I don't want to restart.

    I tried attaching to the troublesome process with a debugger, but it said "cannot attach to crashing process" or something like that.

    The given process *may* be CreateProcess'd by another program, but I don't recall if it was in this instance or not and I'm not sure what that would have to do with it.

  10. #10
    Join Date
    Mar 2003
    Location
    India {Mumbai};
    Posts
    3,871

    Re: Can't kill my process to rebuild the app

    That means the process is attached with a debugger. The process has caused some exception that is causing some debugger (like Dr. Watson) to be attached with this process.

    And if you are only concerned about generating new EXE, you can just rename the outfile in project settings. True, that's not optimal solution. You need to look up what's holding the process/crashing-process.

    AFIAK, Process Explorer doesn't show if debugger is attached.
    My latest article: Explicating the new C++ standard (C++0x)

    Do rate the posts you find useful.

  11. #11
    Join Date
    Sep 2005
    Location
    London
    Posts
    208

    Re: Can't kill my process to rebuild the app

    Quote Originally Posted by Ajay Vijay View Post
    AFIAK, Process Explorer doesn't show if debugger is attached.
    It actually does.
    Find->Handle or DLL substring

  12. #12
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: Can't kill my process to rebuild the app

    Quote Originally Posted by Ajay Vijay View Post
    That means the process is attached with a debugger. The process has caused some exception that is causing some debugger (like Dr. Watson) to be attached with this process.
    Wow, that must have been it. I closed all my instances of Visual Studio and the process finally went away! Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured