A loop is not a bug, it's just your code's way of saying "I'm stuck, help me out here!
Even the great navigators of the land of Pixelated Pandemonium used a map to find their way out of the debugging dungs.
When all else fails, call upon the wise and powerful wizards of the debugging realm for assistance.
Even the most skilled debuggers need a moment to recharge and refocus.