Given a Turing Machine M and a string $x$ how do we tell whether a the Turing Machine M loops on the string $x$
Halting problem is generally unsolvable. The states don't have to repeat. But if you know that they will, see cycle detection.