RISC Ultrix process looping problem
Hans Breitenlohner
hans at umd5.umd.edu
Thu May 31 11:25:15 AEST 1990
In article <1892 at gannet.cl.cam.ac.uk> maj at cl.cam.ac.uk (Martyn Johnson) writes:
>Ever since we've had our DECstation 3100s and DECsystem 5400s we've been
>troubled with user processes which should have gone away sitting eating
>CPU time instead.
I have fixed one such problem with Mail. Diffs follow below. The problem
was that a routine sits and spins forever when getting an error on
stdin (such as a dropped network connection). The old assumption that
errors on stdin are temporary is not valid any more.
Berkeley has fixed that problem long ago, but Ultrix's /usr/ucb/Mail is
based on sources that are about six years old. I would suspect that
similar mechanisms are involved in the problems you see.
*** fio.c.old Wed Oct 4 13:19:48 1989
--- fio.c Thu Oct 5 18:59:13 1989
***************
*** 175,180
return(c+1);
}
/*
* Quickly read a line from the specified input into the line
* buffer; return characters read.
--- 175,181 -----
return(c+1);
}
+ #if 0
/*
* Quickly read a line from the specified input into the line
* buffer; return characters read.
***************
*** 206,211
*cp = 0;
return(cp - linebuf + 1);
}
/*
* Read up a line from the specified input into the line
--- 207,213 -----
*cp = 0;
return(cp - linebuf + 1);
}
+ #endif
/*
* Read up a line from the specified input into the line
***************
*** 220,226
register char *cp;
register int c;
- do { /*read while no errs & stdin ==file*/
clearerr(ibuf); /*reset err indication on input*/
c = getc(ibuf);
for (cp = linebuf; c != '\n' && c != EOF; c = getc(ibuf)) {
--- 222,227 -----
register char *cp;
register int c;
clearerr(ibuf); /*reset err indication on input*/
c = getc(ibuf);
for (cp = linebuf; c != '\n' && c != EOF; c = getc(ibuf)) {
***************
*** 229,235
if (cp - linebuf < LINESIZE-2)
*cp++ = c;
}
- } while (ferror(ibuf) && ibuf == stdin);
*cp = 0; /*terminates line*/
if (c == EOF && cp == linebuf) /*if @ beginning of line & char=EOF*/
return(0); /* then return 0*/
--- 230,235 -----
if (cp - linebuf < LINESIZE-2)
*cp++ = c;
}
*cp = 0; /*terminates line*/
if (c == EOF && cp == linebuf) /*if @ beginning of line & char=EOF*/
return(0); /* then return 0*/
More information about the Comp.unix.ultrix
mailing list