So I\'m debugging my python program and have encountered a bug that makes the program hang, as if in an infinite loop. Now, I had a problem with an infinite loop before, but
I wrote a module that prints out threads that hang longer that 10 seconds at one place. hanging_threads.py
Run:
python -m pip install hanging_threads
Add this to your code:
from hanging_threads import start_monitoring
start_monitoring(seconds_frozen=10, test_interval=100)
Here is an example output:
-------------------- Thread 5588 --------------------
File "C:\python33\lib\threading.py", line 844, in _exitfunc
t.join()
File "C:\python33\lib\threading.py", line 743, in join
self._block.wait()
File "C:\python33\lib\threading.py", line 184, in wait
waiter.acquire()
This occurs at the exit of the main thread when you forget to set another thread as daemon.