Subject: Runaway Pine bug solved, patch included

From: Sean Vickery <[email-masked]>
Date: 14 Aug 1995 06:09:11 GMT

[If you reply or followup to this, could you please Cc: me as I read neither
 pine-info nor comp.mail.pine.]

Fellow Pine users,

After some frustrating months of tracking down runaway Pine processes each
day and killing them by hand, I decided to find and fix the cause of the
problem in the Pine sources.

Some debugging revealed that the hanging Pines are doing a tight loop
in read_with_timeout().  The logic in this function is slightly awry;
it does not cater for read(terminal) returning zero bytes.  My patch is at
the end of this message;  it's a one-line fix.  Not one Pine has run away
since I patched them a week ago.  Before I patched Pine, I was getting
about one runaway Pine per day per machine on average.

I saw the problem only with Pine 3.91.  Pine 3.89, which we still use
on some of our machines, has never runaway on us.  Pine 3.91 was running
away on both Solaris 2.3 and 2.4.

If there are any Pine developers reading this, perhaps you could fix the
bug in the next release of Pine.

Cheers for now,
Sean.

-- 
Sean Vickery <[email-masked]>   Ph: +61 (0)7 3875 6410
Systems Programmer   Information Services   Griffith University
===================================================================
RCS file: /opt/cvs/pd/pine/pine/ttyin.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -c -r1.1.1.1 -r1.2
*** 1.1.1.1	1995/01/13 00:16:30
--- 1.2	1995/08/14 05:57:29
***************
*** 1,5 ****
  #if !defined(lint) && !defined(DOS)
! static char rcsid[] = "$Id: ttyin.c,v 4.56 1994/10/11 22:53:43 mikes Exp $";
  #endif
  /*----------------------------------------------------------------------
  
--- 1,5 ----
  #if !defined(lint) && !defined(DOS)
! static char rcsid[] = "$Id: ttyin.c,v 1.1.1.1 1995/01/13 00:16:30 seanv Exp $";
  #endif
  /*----------------------------------------------------------------------
  
***************
*** 389,395 ****
           dprint(1, (debugfile, "\n\n** Error reading from tty : %s\n\n",
                  error_description(errno)));
  
!          if(errno == EINTR)
             return(NO_OP_COMMAND);
  
           if(ps_global->inbox_stream != NULL){
--- 389,395 ----
           dprint(1, (debugfile, "\n\n** Error reading from tty : %s\n\n",
                  error_description(errno)));
  
!          if(res < 0 && errno == EINTR)
             return(NO_OP_COMMAND);
  
           if(ps_global->inbox_stream != NULL){
--
Sean Vickery <[email-masked]>   Ph: +61 (0)7 3875 6410
Systems Programmer   Information Services   Griffith University