when you feel that you are inside some infinte loop during debugging, check the code and just
make a breakpoint after this possible loop and try to exit, you get an idea if
the breakpoint hit after this cycle, also after that you can analyze what is wrong in your
a variable either from this part of the code or to restart the sample reproduced in gdb.
Anand source share