in reply to Program hangs

If it's single-threaded and you're sending emails, maybe an SMTP connection is getting hung. If neither you nor the far end server times out, it would appear that your program had stopped.

Alternatively, you might have several slow connections, and when you come to look at the progress, it just happens to be stuck on one of them. How long have you left it just sitting there? It might come back after a while.

Replies are listed 'Best First'.
Re: Re: Program hangs
by Stegalex (Chaplain) on Jan 27, 2002 at 23:26 UTC
    It is single-threaded, although it doesn't interact directly with SMTP, it passes a command to a different machine. The other machine actually forms the mail message.

    The program is stopping printing right in the middle of printing a variable. This is the sort of thing that happens when you run out of disk space, although I have plenty of space in the filesystem.

    The process can hang for days without moving. It took me a couple of days before I noticed the problem because there were no obvious signs of errors such as stderr, stdout, logfile entries.
      What does the other machine (the receiver) think is happening? Are the commands being passed down a constantly-open channel which is getting clobbered by an intervening firewall after a certain length of time?

      Oh, and if this is on Linux, cat /proc/sys/fs/file-nr while the program is hung. You may have run out of filehandles (although you'll have a hard time launching a shell etc. if that's the case).