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
1 answer
Android alarmManager gets into loop
I have a service, which I want to run each day so check some stuff in my db, and if needed create a notification.
To run my service each day, I used an alarmManager, which works fine for the first time, but as soon as in starts my services gets in…

Muhammad Naderi
- 3,090
- 3
- 24
- 37
1
vote
3 answers
Simple Tic Tac Toe on excel VBA
I'm trying to make a very simple Tic Tac Toe for a class I have where instead of X and O you color the cells interior blue (user) and red (macro) and no AI.
but whenever I think I got it it goes into an infinite loop
Sub Tic()
Dim r1 As Integer
Dim…

user4314115
- 11
- 1
- 6
1
vote
1 answer
infinite loop through a list, enumeration
So im building an application in swing that will ping a url or a list of urls to show the machines status. So if a machine disconnects it will show up as disconnected. I have a list of machines but I need it to loop over forever in intervals so I…

Adilp
- 429
- 1
- 7
- 21
1
vote
8 answers
For loop won't end. Don't know why
I'm writing a for loop for a project that prompts the user to input a number and keeps prompting, continually adding the numbers up. When a string is introduced, the loop should stop. I've done it with a while loop, but the project states that we…

CodeNovice
- 343
- 1
- 11
1
vote
1 answer
Javascript regex causes unresponsive script
I have this regex:
var reg = /^(\w+ ?)+&(\w+ ?)+$/;
and this string:
var string = "number number number number number number number&";
When I execute:
reg.test(string);
this causes an unresponsive script message. I think this is due to…

Clouchti Bat
- 15
- 2
1
vote
1 answer
Interactions Pane stops and keeps on displaying a loading icon after inputing something
I have a coding assignment for my class that involves checking for characters for a "Tweet tester". There is something wrong with the following code, and I believe that it's an infinite loop, but I don't know what's causing it. Basically, every time…

Carson T.
- 15
- 6
1
vote
1 answer
Weird behavior in Java While Loop
I am writing a basic Tic-Tac-Toe Single player game using basic swing graphics. I completed the game, but there is a weird problem I am facing. At one place, I used a while loop with a SOP statement. If I omit this statement, program works…
user2776601
1
vote
1 answer
symfony multiple controller actions rendered in unique template - maximum nesting level reached
I am using JavaScript tabs to render different layouts corresponding to different views with different forms.
I have a main route as follows :
/**
* @Route("/my_ingredients", name="my_ingredients")
* @Method("GET")
*…

Sébastien
- 5,263
- 11
- 55
- 116
1
vote
2 answers
Java - Why is this an infinite loop and how can I fix it?
Here is small snippet of a program I'm currently working on where the infinite loop is occurring. I have set all the variables to the values they are at in the program when it encounters this loop. The goal of this loop is to get it to either break…

Hunter Corry
- 61
- 9
1
vote
2 answers
C++ continue statement leading to infinite loop
I'm currently working on a fairly basic piece of code here. I'm attempting to check the user's input so that if it is anything other than a number as requested, an error message will pop up and a new input will be requested. I'm using a while loop…

Dozar
- 71
- 2
- 2
- 6
1
vote
1 answer
Need alternative way to stop my game (pygame)!
When the timer ends, I want the 'Game Over' text to display and everything else to stop executing. My program crashes on line 65 (the while-loop inside my game-loop, after time == 0). What's an alternative way to do this other than an infinite…

Nathan
- 11
- 1
1
vote
1 answer
Aspectj - how to call advised method from within same advice, without triggering an infinite loop
i want to log all method call i make in my code except the ones within the logger, using AspectJ.
@Aspect
public class Logger
{
// Point Cuts
//-----------
@Pointcut("execution(* org.myDomain.*..*.*(..))")
public void selectAll(){}
…

Tal
- 31
- 9
1
vote
2 answers
Infinite loop when calling a method
When I try to use my Compare method in my Bubblesort code to determine the alphabetical order of strings to sort, I get stuck in an infinite loop in the Compare method, which works otherwise.
Any ideas?
Thanks!
public static int Compare(String s1 ,…

Jacket
- 93
- 6
1
vote
1 answer
Servlet endless loop
I hope you can help handle problem with endless loop in servlet. Such problems usually causes wrong servlet-mapping (usualy it's "/*"). But in my case, it has specific value - name of conrete jsp file.
Servlet:
public class TrainsListServlet extends…

iartemov
- 23
- 6
1
vote
1 answer
fgets gets stuck into an infinite loop while reading /proc/PID/maps
I'm trying to read from /proc//maps file. I ptrace(PTRACE_ATTACH, ) before reading (so, the process is supposed to be suspended).
The code that reads looks like this:
while(fgets(line_buf, BUFSIZ, maps_fd) != NULL){ ... }
but it's not…

alexandernst
- 14,352
- 22
- 97
- 197