I'm getting an unbelievable infinite loop and old_sting error

This problem has increased a lot recently. I constantly encounter the same problem.

After looping in this way, even if I stop it and give new commands, most of the time it can’t get out of this loop. Old_string is also getting very annoying.