Endless debugging loop in Visual Studio 2010

I have a strange problem with VS2010 (creating a big project in C ++). When you start debugging, execution is performed as an endless loop. I set a breakpoint in the first line of main (), but a breakpoint was never reached. I also tried F11 to go to main (), but no effect. The task manager shows an instance of my application, and the console says nothing but "Loaded xxx.dll characters." I tried to pause execution, but I ended up in some kind of assembly loop, here is the assembly, if someone can read it:

0000000077226129 lea rdx,[rsp+88h] 0000000077226131 xor ecx,ecx 0000000077226133 call 0000000077231650 0000000077226138 mov dword ptr [rsp+30h],eax 000000007722613C test eax,eax 000000007722613E js 000000007725E73F 0000000077226144 cmp dword ptr [7731201Ch],r14d 000000007722614B je 0000000077226129 

Can someone tell me or at least tell me how to approach this problem?

Edit: I found out that when you delete one of the shared libraries (FlyCapture2, developed by Point Gray Research), the application starts up normally. There seems to be some kind of loading method in the library that is called before main () is executed. Despite the fact that I solved my current problem, I still would like to know: how to detect such problems?

+7
source share
2 answers

I think I found the problem. In one of my DLLs, I had a singleton class. In the header file, I had getter LogManager :: instance () and the destroyer void LogManager :: destroyInstance (). The instance was defined in the .cpp file, but not statically, but just like a global variable

 LogManager* sInstance = new LogManager; 

and the instance () function just returned this variable, and the destroyInstance () function deleted it. So I deleted the global variable and created this instance inside the instance () function

 void LogManager::instance() { static LogManager* sInstance = 0; if(!sInstance) sInstance = new LogManager; return sInstance; } 

and the problem disappeared. So, I think, perhaps, a global variable in this DLL caused an infinite loop during loading of this DLL? Perhaps this is a hint for people with similar problems.

+1
source

How to connect to DLL (s) correctly is a big problem. This is up to the applications, so it’s hard for us to find it and solve it. But when I had a question about DLL (s), I will also search for answers on the Internet. And each error has its own serial number. This is the key. He also says β€œLNK **** ........” in the β€œerror list”. So that I can find it and even solve it myself according to information from others.

PS: Your code is called "Machine Instruction". This is part of computer principles.

0
source

All Articles