[news.software.nntp] rrn dies when brought back into foreground

roy@phri.nyu.edu (Roy Smith) (12/10/89)

	A few weeks ago I install rrn on our Sun-3/50s running SunOS-3.5.2.
Every once in a while, if you suspend rrn, when you bring it back into the
foreground, you get "read error: not owner" and rrn exits.  Anybody have
any idea what's going on?  We're running rrn 4.3.1.4, patchlevel 39.

	It also seems like it occasionally misses input when you type a
space in response to a prompt.  Has anybody else seen this?
-- 
Roy Smith, Public Health Research Institute
455 First Avenue, New York, NY 10016
{att,philabs,cmcl2,rutgers,hombre}!phri!roy -or- roy@alanine.phri.nyu.edu
"The connector is the network"

rmtodd@servalan.uucp (Richard Todd) (12/12/89)

(Apologies if you see this twice--looks like it didn't make it out the
first time I sent it.)

In article <1989Dec10.153749.23565@phri.nyu.edu> roy@phri.nyu.edu (Roy Smith) writes:
>
>	A few weeks ago I install rrn on our Sun-3/50s running SunOS-3.5.2.
>Every once in a while, if you suspend rrn, when you bring it back into the
>foreground, you get "read error: not owner" and rrn exits.  Anybody have
>any idea what's going on?  We're running rrn 4.3.1.4, patchlevel 39.
>
>	It also seems like it occasionally misses input when you type a
>space in response to a prompt.  Has anybody else seen this?

  Well, we don't use rrn much in this neck of the woods, but I've seen the
same things happen on regular rn.  (Rrn *is* just rn hacked to do NNTP
article reads, i.e. a large part of the code is the same in both, isn't
it?)  This is on uokmax, an Encore Multimax, both on Umax 4.0-beta (their
4.3-Tahoe port), and previously on Umax 3.3 (their BSD4.2 port); I believe
the version of rn is also patchlevel 39, but I'd have to check.  The "read
error" doesn't happen too often, but the dropping spaces happens with some
regularity.  Neither problem has happened so far with rn running under A/UX
on my Mac IIx, but I've only had it running on here for a few months.  

  Furthermore, we've also seen the phenomenon where rn gives the "read
error: not owner" message, then says "Caught an internal error, .newsrc
restored".  Then when you check, you find that your .newsrc has disappeared
without trace.  I think most of the people who read news on uokmax are now
careful to make regular backups of their .newsrc in separate files, just in
case.  It's rather irritating to have that happen to you.  I'd love to see
a fix....

  Any rn gurus out there got any ideas about what's happening here?
--
Richard Todd	rmtodd@uokmax.ecn.uoknor.edu  rmtodd@chinet.chi.il.us
	rmtodd@servalan.uucp
Motorola Skates On Intel's Head!

chris@uxf.cso.uiuc.edu (Christopher Martin) (12/12/89)

In article <1989Dec10.153749.23565@phri.nyu.edu> roy@phri.nyu.edu (Roy Smith) writes:
>
>	A few weeks ago I install rrn on our Sun-3/50s running SunOS-3.5.2.
>Every once in a while, if you suspend rrn, when you bring it back into the
>foreground, you get "read error: not owner" and rrn exits.  Anybody have
>any idea what's going on?  We're running rrn 4.3.1.4, patchlevel 39.
>

I just hunted this down this afternoon.  It seems to me that there may be
a bug in the code.  It seems that errno shouldn't be looked at unless read_tty
returns an error.  Here's a diff off rrn 4.3.2.5:


*** term.c.DIST	Mon Dec 11 14:17:41 1989
--- term.c	Mon Dec 11 14:44:16 1989
***************
*** 733,744 ****
      for (;;) {
  	int_count = 0;
  	errno = 0;
! 	if (read_tty(whatbuf,1) < 0 && !errno)
! 	    errno = EINTR;
! 	if (errno && errno != EINTR) {
! 	    perror(readerr);
! 	    sig_catcher(0);
! 	}
  #ifdef PUSHBACK
  	if (*whatbuf & 0200 || no_macros) {
  	    *whatbuf &= 0177;
--- 733,745 ----
      for (;;) {
  	int_count = 0;
  	errno = 0;
! 	if (read_tty(whatbuf,1) < 0)
! 	    if (!errno)
! 		errno = EINTR;
! 	    else {
! 		perror(readerr);
! 		sig_catcher(0);
! 	    }
  #ifdef PUSHBACK
  	if (*whatbuf & 0200 || no_macros) {
  	    *whatbuf &= 0177;