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
1
vote
3 answers
Handle infinite loop in third party javascript file (c# .net)
I need to load a third party script file(which I do not have any control), but I want to avoid hanging the page in case the script has an infinite loop in it.
I tried calling the javascript file and put it in an updatepanel only on a click of a…

jbdeguzman
- 926
- 7
- 11
1
vote
3 answers
Looping javascript?
I am new to js, and jquery, and I am trying to fade in and out list items.
Im using the jQuery Cycle Plugin (with Transition Definitions).
Its working just fine, however I need this to loop. I am sure its something simple. However I cannot find a…

Jef Rechards
- 84
- 1
- 7
1
vote
1 answer
Lua Least Common Multiple Program Not Enough Memory
This is a Lua program I wrote to find the least common multiple of two numbers. When I run it, it asks for two numbers as intended, but when it tries to run them through the function, it runs out of memory.
function lcm(a,b)
aList={}
…

user2604809
- 13
- 3
1
vote
0 answers
How to catch the mocked infinite loop behavior and handle it with a rescue block using RSpec
I have a Book Model which is a ruby script that assigns prices to certain predefined Book titles mentioned in the program. I'm using Ruby 1.9.3-p327 and rspec 2.11.0
#class RspecLoopStop < Exception; end
class Book
attr_accessor :books
def…

boddhisattva
- 6,908
- 11
- 48
- 72
1
vote
4 answers
Prevent infinite loop between objects referencing each other?
Okay, so I wasn't completely sure what headline would fit my problem, but here goes the description:
I have objects than can reference other objects, to create dropdown lists where the content/values is dependant on what values is chosen in "parent"…

David K
- 3,153
- 5
- 18
- 27
1
vote
1 answer
How to avoid infinite loop when trying to load a 404-Not-Found favicon in Chrome?
I've read that Chrome keeps asking for the favicon in each page it visits (link), and if it doesn't find it (404 Not found) then Chrome enters in a infinite loop.
I'm afraid that is happening to my app, although it works fine with Firefox or Safari.…

rafamontoya
- 78
- 1
- 7
1
vote
0 answers
I've read all the other threads but no bueno. Is my .htacess rule creating an infinite loop?
Whenever I type a made up address that includes a directory index it removes it. The problem is when the the address includes a forbidden subdirectory. It reduces itself until it hits forbidden. How do I get it to redirect to the homepage instead of…

user25687
- 11
- 1
1
vote
2 answers
Simple Python Webbrowser Loop
I am trying to have this program open a tab, wait for 15 seconds, then quit Chrome and reopen the tab immediately. Right now, it opens a tab, waits for 15 seconds then closes Chrome and waits for another 15 seconds before reopening it. How would I…

Nick
- 13
- 1
- 4
1
vote
3 answers
Java Endless While Loop
I have the following code:
boolean[] usedInts = {false, false, false, false, false, false, false, false, false};
for(int i = 0; i <= 8; i++) {
JLabel square = squares[i];
// Declare coordinate
Coordinate coordinate = null;
boolean…

Shlomo Zalman Heigh
- 3,968
- 8
- 41
- 71
1
vote
1 answer
Can compilers detect infinite looping condition?
I'm building a compiler for a custom language. Is it possible for the compiler to detect any infinite looping condition without running the program?
If so how can I implement it?

Ashrith Sheshan
- 654
- 4
- 17
1
vote
4 answers
java while loop with periodic break receives out of memory exception
I have the following loop that listens for UDP messages coming in
public void run(){
int count = 0;
boolean loopRecv = true;
while (loopRecv) {
count++;
if (count == 500) {
…

Atma
- 29,141
- 56
- 198
- 299
1
vote
3 answers
Why is my Swing application freezing?
Basically, every time I click on one of my JButtons, it just locks up. I have been looking around and found out that it may be because of an infinite loop, but I cannot see one anywhere.
A fresh pair of eyes would come in very handy!
Anyways, here…

knorberg
- 462
- 5
- 19
1
vote
1 answer
Waiting function has logic error
I have created an program that automates certain functions at my place of business but I'm trying to dummy proof it so it cannot go wrong and I have encountered an error that should not be occurring.
Basically what my method is doing is waiting…

Joel Newman
- 58
- 6
1
vote
1 answer
A field defined by a method that uses that same field... circular definition in Java is hurting my head
I came across this code on Vogella which demonstrates creating a LabelProvider for a JFACE tree.
I'm finding it really confusing however. The Image objects, named FOLDER and FILE are defined by calling a method which returns either FOLDER or…

CodyBugstein
- 21,984
- 61
- 207
- 363
1
vote
1 answer
C++ Infinite Loop causing a stack overflow error?
Okay, so I've been working on my calculator. I am currently trying to get it to tell the difference between a valid integer and a character. As an easy workaround I did:
int calc()
{
cout << "Number 1:"; cin >> fnum;
cout << "Number 2:"; cin >>…

Chris Altig
- 680
- 3
- 8
- 22