Infinite loop

Infinite loop

I have an executable that goes into an infinite loop before it executes the first line of code. I put a number of write statements at the start to see if they were hit. But It doesn't generate any output.  The code has /Qopenmp and will have several threads eventually if that matters, and has calls to several DLLs eventually too.  The same code built on another machine works fine.  Any idea what it could be executing?

8 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

you'll need to provide some idea of what your code does at startup What are the first few lines? what might it be doing that would go into an infinite loop? we need some clue(s) to what it is doing.

I think you missed the point.  The first line of my code is WRITE(*,*)'STARTED'.  This doesn't happen. But I know the compiler adds code to initialization.  That is where it is stuck, the question is why.

I also tried writing to other units. 

You will have to explain a bit more about your code. It does not produce any output, you say. And you have the idea that it is running in an infinite loop. That means the process is active and is consuming CPU. Since it is not looping in your code, something else must be going on.

Can you describe how you built your program? Any libraries? What version of the compiler? If you check the dependencies with a program like Dependency Walker, do you see any unusual DLLs popping up in the list?

Do you write to the screen or to a file? If the latter, try using an absolute file name, like "c:\tmp\myoutput.txt" - it may be running in a different directory than you think.

How do you start it? Within Visual Studio?

We simply need to know more about your program and the way you built it to help you.

Not all programs with the characteristics that you described (compiled with /Qopenmp, linked to a number of DLLs, etc.) will hang up before reaching the first line of code. In fact, I have not seen a single program that does this, spanning a period of  a number of years.

Therefore, we need more information from you before attempting to look for causes.

Here is a picture of the call stack I get when I start it running in the debugger.  Note that I put a break on my first executable statement.

This was compiled with using VS10.  Same problem using 13.0.  Libraries built with or 11.1.072. Various builds with the dlls.  But note that all these combinations of the libraries and DLLs seem to work fine on other machines. Only the executable is built on this machine, the libraries and DLLs are the same everywhere else. And both versions of the compiler were uninstalled and reinstalled several times, as well as the libraries and DLLs.


Downloadimage/x-ms-bmp iloop.bmp790.62 KB

I suggest rebooting into Safe Mode and try running the program to see what happens. It could be there's some background process interfering with it.

Retired 12/31/2016

turns out it is the HP Protect Security Manager - the finger swipe verification system that gets in there and causes the issue. Disabling that software fixes the infinite looping.

Leave a Comment

Please sign in to add a comment. Not a member? Join today