View Single Post

   
  #5 (permalink)  
Old 01-05-2008, 10:47 AM
Jurjen Oskam
 
Posts: n/a
Default Re: How to find out if process is in a loop?

On 2006-11-12, Hemant Shah <shah@typhoon.xnet.com> wrote:

> I have the source code, and the problem occurs when programmer
> makes change to the application and runs it. The programmer may not monitor
> the program so as sys admin I want to be able to catch it before it affects
> other users.


My point was: you can't tell whether a program is in an infinite loop from the
outside. With knowledge about how the program *should* behave, you can try to
determine whether the program still functions correctly. For example, if the program
was designed to write a line to a file every 5 seconds, you know there's something
wrong when this doesn't happen. But even then, the problem might not be in the
program itself: the machine it's running on may be overloaded.

Your best solution is to think of a way to monitor the program from a script.
You need to find criteria to determine if the program is still correctly running,
and this depends greatly on the particular program.

--
Jurjen Oskam
Reply With Quote