A server program is on an infinite loop. How to check for it?
My solution:
use GDB to check the values of condition variables that control the loop.
It is ok for small program.
how to do that for large program ?
If the program is not running in GDB, how to detect the endless loop ?
thanks
You could use some form of a watchdog timer. Have the program output a character or touch a file periodically, so if it gets stuck in a loop, a separate process can detect that the watchdog has not been updated and kill/reset the process.
A lot of microcontrollers have this built into the hardware, and they will automatically reset if you don't reset the timer. It's very handy :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With