An "infinite loop" is a loop in which the exit criteria are never satisfied; such a loop would perform a potentially infinite number of iterations of the loop body. The general problem of determining whether the execution of a loop with given preconditions will result in an infinite loop is undecidable; in other words, there is no algorithm to determine whether an execution of a loop will eventually terminate. This is known as the halting problem.
Questions tagged [infinite-loop]
3528 questions
8
votes
8 answers
SQL Server Trigger loop
I would like to know if there is anyway I can add a trigger on two tables that will replicate the data to the other.
For example:
I have a two users tables, users_V1 and users_V2, When a user is updated with one of the V1 app, it activate a…

Roch
- 21,741
- 29
- 77
- 120
8
votes
1 answer
AngularJS InfDig error (infinite loop) with ng-repeat function that returns array of objects
Here's my code:
something
$scope.func = function(){ return [{"property" : "value1"},{"property": "value2"}]; } In Angular.js v. 1.1.1 there's no mistake. In Angular.JS v 1.2.1 I get an infDig mistake. Fiddle…
user3162402
- 743
- 1
- 7
- 7
8
votes
7 answers
Get stacktrace from stuck python process that does not accept signals
I have to run a legacy Zope2 website and have some grievance with it. The biggest issue is that, occasionally, it just locks up, running at 100% CPU load and not answering to requests anymore. While the problem isn't reproducible on a regular basis,…

Benjamin Wohlwend
- 30,958
- 11
- 90
- 100
8
votes
12 answers
Idom for infinite loops in PHP?
While reading through the great online PHP tutorials of Paul Hudson he said
Perhaps surprisingly, infinite loops
can sometimes be helpful in your
scripts. As infinite loops never
terminate without outside influence,
the most popular way to…

taabouzeid
- 939
- 8
- 17
- 26
8
votes
6 answers
Switch statement within while loop in C
There are several postings concerning switch statements within while loops, except for the fact that none of them are done in C, at least from what I've seen. C++ can create boolean expressions, which I'm aware of, but not in C. I have a while loop…

umarqattan
- 499
- 1
- 6
- 13
8
votes
4 answers
Javascript: possible for parent to kill child iframe if it is stuck in an infinite loop?
I have a page that has an iframe with external content. I don't want infinite loops in the external content to crash my whole page. Is there any way to get around this.
I tried to set something up where the parent postMessages the child iframe…

asutherland
- 2,849
- 4
- 32
- 50
8
votes
4 answers
How to stop infinite loop in bash script gracefully?
I need to run application in every X seconds, so, as far as cron does not work with seconds this way, I wrote a bash script with infinite loop having X seconds sleep in it.
When I have to stop the running script manually, I would like to do it in a…

Samurai Girl
- 978
- 2
- 8
- 13
8
votes
2 answers
Python build goes into infinite loop
When trying to build Python 2.7.3 on Snow Leopard, it seems the Make process gets stuck in an infinite loop. It appears that the configure script gets called over and over, which is odd because it is the configure script that creates the Makefile in…

wonderlr
- 165
- 2
- 5
8
votes
2 answers
Why is infinite loop protection being triggered on my CRM workflow?
Update
I should have added from the outset - this is in Microsoft Dynamics CRM 2011
I know CRM well, but I'm at a loss to explain behaviour on my current deployment.
Please read the outline of my scenario to help me understand which of my…

Greg Owens
- 3,878
- 1
- 18
- 42
8
votes
11 answers
How to detect an infinite loop in a recursive call?
I have a function that is recursively calling itself, and i want to detect and terminate if goes into an infinite loop, i.e - getting called for the same problem again. What is the easiest way to do that?
EDIT: This is the function, and it will get…

Pranav
- 3,340
- 8
- 35
- 48
7
votes
12 answers
Are endless loops in bad form?
So I have some C++ code for back-tracking nodes in a BFS algorithm. It looks a little like this:
typedef std::map MapType;
bool IsValuePresent(const MapType& myMap, int beginVal, int searchVal)
{
int current_val = beginVal;
while…

rlbond
- 65,341
- 56
- 178
- 228
7
votes
2 answers
cpu usage increasing up to 100% in infinite loop in thread
I am implementing a web based chat platform in ASP.NET Web Application, and I use technique similar to long polling. I mean I keep each web request from client for a specific time period(timeout) or until new message arrives, and then response is…

Mehmet
- 211
- 1
- 4
- 12
7
votes
4 answers
How to detect and avoid infinite loops?
I want to make sure that my web application is performance wise and will not make any performance problems. When I searched, I found that one of the most common problems related to the performance issue is the "infinite loops" problem.
I want to…

Anyname Donotcare
- 11,113
- 66
- 219
- 392
7
votes
5 answers
Infinite for loop in Python
I'm new to Python. Actually I implemented something using Java as shown below.
for(;;){
switch(expression){
case c1: statements
case c2: statements
default: statement
}
}
How do I implement this in Python?

Kiran Bhat
- 3,717
- 4
- 20
- 18
7
votes
1 answer
python exit infinite while loop with KeyboardInterrupt exception
My while loop does not exit when Ctrl+C is pressed. It seemingly ignores my KeyboardInterrupt exception. The loop portion looks like this:
while True:
try:
if subprocess_cnt <= max_subprocess:
try:
notifier.process_events()
…

sadmicrowave
- 39,964
- 34
- 108
- 180