Subject: 3.92 on Solaris 2.5

From: [email-masked] (Jim Davis)
Date: 5 Apr 1996 14:10:41 -0700

With both the precompiled binary and one I built from source I've
noticed that sometimes when I log off pine 3.92 keeps running, and
consumes a lot of cpu cycles in the process.  Has anyone else seen
this?
-- 
Jim Davis
[email-masked]	http://www.cs.arizona.edu/people/jdavis

---

From: [email-masked] (Paul Lyon)
Date: 7 Apr 1996 20:04:21 GMT

Jim Davis ([email-masked]) wrote:
: With both the precompiled binary and one I built from source I've
: noticed that sometimes when I log off pine 3.92 keeps running, and
: consumes a lot of cpu cycles in the process.  Has anyone else seen
: this?

In a word, yes. It hasn't happened often, tho'. The more typical problem
for us has been one of Pine hanging on startup and then refusing to perish
even if one does 'kill -9' on the process id. Sometimes, after a while,
Pine would finish starting up and become useable, sometimes not. I assume
that Pine was waiting on some system resource or other that it could not
acquire, but I haven't a clue what.

I haven't a clue about why Pine might live on as a cpu hogging zombie, 
except that the cpu cycles were probably accumulated polling for keyboard 
input.

Ciao,

Paul

--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Paul Lyon                                  | "Without true justice
Liberal Arts Computer Lab                  |  there can be no peace."
University of Texas at Austin              |         Lucretia Coffin Mott
email: [email-masked]                   |
'phone: 512-471-5121 *** fax: 512-471-1061 |
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

---

From: [email-masked] (Mr. Jim Harle {CSERV STAFF})
Date: 8 Apr 1996 20:10:05 GMT

We see the same problem with Pine 3.91 and Solaris 2.4 and 2.5.  It's not
just pine that has the problem, though.  I wrote our menuing system and
it was doing the same thing, but more so than Pine.  I found that when
a user leaves ungraciously, SIGHUP is sometimes not received and that
reads on the tty/pty return the null character.  I "fixed" my menu system
by doing a count of the number of null characters it receives in a row
and when that exceeds a certain limit (arbitrarily 10), it says "do you
really want to quit" and accepts a null character as meaning No.  Thats
an ugly way of doing things, but the menu never hangs any more.  Pine is
the second most used thing after the menu and we get about 1 hang per
5-10,000 uses.  Sun didn't have a solution several month ago when we
called.
  --Jim Harle, US Naval Academy

: -- 
: Jim Davis
: [email-masked]	http://www.cs.arizona.edu/people/jdavis

---

From: [email-masked] (Udo Keller)
Date: 10 Apr 1996 13:47:01 GMT

Paul Lyon ([email-masked]) wrote:

: In a word, yes. It hasn't happened often, tho'. The more typical problem
: for us has been one of Pine hanging on startup and then refusing to perish
: even if one does 'kill -9' on the process id. Sometimes, after a while,
: Pine would finish starting up and become useable, sometimes not. I assume
: that Pine was waiting on some system resource or other that it could not
: acquire, but I haven't a clue what.

We observe the same on Solaris 2.3 SPARC and Solaris 2.5 x86. In both cases,
we have compiled pine with the original SUN compiler. No clue yet.

Cheers, Udo
----------------------------------------------------------------
Dr Udo Keller                   
Theoret.Biol.Dept.
Cologne University
Weyertal 119
D-50923 Cologne                    email: [email-masked]
----------------------------------------------------------------

---

From: Pine Maintainer <[email-masked]>
Date: Thu, 11 Apr 1996 16:52:50 +0100 (BST)

> consumes a lot of cpu cycles in the process.  Has anyone else seen

Yes - assuming that you are compiling with USE_POLL defined (as is the
case for the gso, sol, and sv4 ports), it will die properly on receiving a
SIGHUP, but won't detect a POLLHUP. The attached patch fixes this problem.

Paul J Murphy
dcs.ed.ac.uk Pine Maintainer
[email-masked]
*** pine3.92/pine/ttyin.c.orig	Fri Mar 15 07:15:57 1996
--- pine3.92/pine/ttyin.c	Thu Mar 28 14:17:09 1996
***************
*** 693,698 ****
--- 693,703 ----
  	 res = poll (&pollfd, 1, time_out * 1000);
  	 dprint(9, (debugfile, "poll on tty returned %d, events %d\n",
  		    res, pollfd.revents));
+          if(pollfd.revents & (POLLERR | POLLHUP | POLLNVAL)) {
+              dprint(1, (debugfile, "\n\n** Bad poll revents!?!\n\n"));
+              read_bail();
+              /* NO RETURN */
+          }
  #else
  	 FD_ZERO(&readfds);
  	 FD_ZERO(&errfds);