Skip to main content
GameDev.net gamedev.net
🔒 Locked

Visual Studio: Debugger doesn't attach error...

Started by Prozak Aug 4, 2010 at 3:52 PM 3 replies 1.8k views
Original Post
Prozak
Prozak
So I open up VS today to resume some work on an old project, hand't work with VS in a while, and this is the same machine I've always coded in.

I try to run the project in debug mode, and nothing happens. I click run in VS, to run the project, it seems to launch the executable, the executable did compile successfully, but alas, nothing happens.

Using the Task Manager I can see my executable there, but it only has 140kb (it usually floats around 15mb), so that tells me that something is wrong...

I create another empty project with only the most basic windows code (just winmain and #include ) and again, same thing happens. I can compile the project, if I run the produced executable from an explorer window, it runs fine, it just seems like the debugger can't attach itself to anything...

This has to be related to automatic updates, doesn't it?

I've started googling for a solution, but if you guys have experienced this, please share what you did and if you found a solution.

Many thanks.
Prozak
Prozak
As a hunch (too many years working with this stuff) I went to my Services, to see if the "Machine Debug Manager" was actually on, because for whatever reason in the past, I had had problems with it turning off.

I can't find the Service on my PC. Now, I believe my version of Visual Studio 2008 doesn't depend on something else for its debugging necessities. It has to depend on mdm.exe. But it's not installed!

So my next step will be to see if I can download it from Microsoft or brave the CD cabinet and try to find the installation CDs...
telaryus
telaryus
OK first thing I want to point out when you say:
Quote:
I create another empty project with only the most basic windows code (just winmain and #include )


This is what I envision:
#include <windows.h>WINAPI int WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd ){  UNREFERENCED_PARAMETER( hInstance );  UNREFERENCED_PARAMETER( hPrevInstance );  UNREFERENCED_PARAMETER( lpCmdLine );  UNREFERENCED_PARAMETER( nShowCmd );  return ERROR_SUCCESS;}


Based on that pretext, if nothing happens, the code is doing exactly what it is supposed to do. Which in this case is entering WinMain doing nothing and then returning which ends the program.

I honestly doubt that Automatic updates would have anything to do with the project not working. Just because I've been writing and running applications in XP from SP1 all the way through SP3 and now on Windows 7.

As for the actual old project that doesn't seem to be running correctly I really can't say much other than agree that the missing MDM might be the cause.
VS is dependent on the Machine Debug Manager for debugging so if it really isn't listed in service.msc then I would say best bet would be to repair/reinstall VS.
"My word is my bond and here I stand."
Prozak
Prozak
Installing the MDM took me nowhere. The VS2008 DVD didn't ran correctly.

So I dug deeper in Google, and found a thread by a bloke that seemingly had the same issue as I did, here.

There he details how his system was infected with a Trojan called Cryptic.AKL.
The Trojan wrote itself into a registry key at "Control\Session Manager\AppCertDlls".

So I ran regedit and did an F3 on "AppCertDlls", and found one DLL there. Mine was called "clicperf.dll" and also had around 46Kb. This DLL was sitting inside "\windows\system32" and was hidden.

I have a tool that tells me what programs have a handle to a file, because I wanted to delete that DLL, but apparently everything in my system had a handle to that DLL file. This told me that this thing was injecting itself into all the code on my machine, and there was a good chance that that was what was messing up my VS2008 debugger.

I also googled "clicperf.dll" to make sure I wasn't deleting something important, but Google returned zero results for this DLL. This told me that the name had to be self-generated. Had this DLL been legit, I would have found something in Google, for example, a mouse driver, or a backup driver for some hardware, whatever, but never zero results.

Now, because this thing had injected itself onto every process on my machine I couldn't close everything just to kill it, I had to do it outside the operating system. So I downloaded another tool called "BootDeleter", that would rename the DLL before it had a chance to infect.

I've rebooted and the DLL has been renamed. Interestingly it has shrank to 32Kb. Its MD5 signature is "8ACDF018015C42C4F1A73B083A58FE9F" but I think that won't help anybody, I have a feeling it's self-altering.

Everything is now working perfectly. Hopefully this thread will help someone else out there...
Prozak
Prozak
Thanks for your contribution Telaryus.

Quote:
Original post by telaryus
...Based on that pretext, if nothing happens, the code is doing exactly what it is supposed to do.
Nah, I've got years of debugging experience, you'd think I would know the difference between the debugger starting and freezing, and starting and exiting. Besides, no breakpoints where ever triggered. Something was definitely up.

Quote:
Original post by telaryus
I honestly doubt that Automatic updates would have anything to do with the project not working. Just because I've been writing and running applications in XP from SP1 all the way through SP3 and now on Windows 7.
Automatic updates do mess up VS from what I dug up, and apparently the biggest culprit is Silverlight. Don't ask me for details though...

Quote:
Original post by telaryus
As for the actual old project that doesn't seem to be running correctly I really can't say much other than agree that the missing MDM might be the cause.
VS is dependent on the Machine Debug Manager for debugging so if it really isn't listed in service.msc then I would say best bet would be to repair/reinstall VS.
From my newfound education that I had in the last 3 hours, apparently Visual Studio above a certain version (2005?) is no longer dependent on MDM. Proof of that is that I'm running VS2008 with no MDM installed (I did try to install it, but the VS2008 DVD repair option failed me, possibly due to the trojan).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.