[TAG] Diagnosing a "hung" process
ny at youngman.org.uk
Sat Oct 15 00:15:07 MSD 2005
On Friday 14 Oct 2005 20:59, Thomas Adam wrote:
> --- Neil Youngman <ny at youngman.org.uk> wrote:
> > There is a program that has mostly worked for years, but occasionally
> > it
> > exhibits some very odd behaviour.
> Out of interest, what language is it written in?
> > The program monitors a "drop directory" and when files matching
> > certain
> > criteria are dropped in, it processes and deletes them. Occasionally
> > this
> > process has been seen to stop processing the files for no apparent
> > reason. If
> > strace is attached to the process using "strace -p pid" the process
> > resumes
> > normal activity.
> I would use "ddd" (or "gdb") and run it through that, which would log
> eveverything, rather than logging the process from the point it hung at
> --- which won't capture the error.
I'm not sure that's viable. It can run for several months on a live system
without a problem. I can't run it in debug for that length of time. It's a
pretty rare occurrence and you can't guarantee that running it in debug won't
prevent it happening at all. OTOH, maybe attaching gdb to the hung process
might prove useful. Not having the source on the live system would make it
difficult to get much information out, but it could yield a few clues.
More information about the TAG