I was horrified whilst scrolling backwards in a file with the less
pager at my console when my 386BSD system suddenly rebooted. Subsequent
tests revealed that the system would crash whenever I scrolled rapidly
backwards through this file using less.
Most files won't cause the system to crash. To demonstrate the failure,
do the the following (if you don't mind watching your system crash):
hd /usr/mdec/bootwd >junk # create a file
less junk # invoke less
G # go to the end of the file
^B^B^B... # rapid repeated control B's to
# scroll backwards
AUTHOR: Frank Maclachlan (fpm@crash.cts.com)
386BSD-Patchkit: patch00010
* SUCH DAMAGE.
*
* @(#)pccons.c 5.11 (Berkeley) 5/21/91
* SUCH DAMAGE.
*
* @(#)pccons.c 5.11 (Berkeley) 5/21/91
+ *
+ * PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
+ * -------------------- ----- ----------------------
+ * CURRENT PATCH LEVEL: 1 00010
+ * -------------------- ----- ----------------------
+ *
+ * 21 Aug 92 Frank Maclachlan Fixed back-scroll system crash
*/
static char rcsid[] = "$Header: /usr/bill/working/sys/i386/isa/RCS/pccons.c,v 1.2 92/01/21 14:35:28 william Exp $";
*/
static char rcsid[] = "$Header: /usr/bill/working/sys/i386/isa/RCS/pccons.c,v 1.2 92/01/21 14:35:28 william Exp $";
if (RB_LEN(&tp->t_out) == 0)
goto out;
c = getc(&tp->t_out);
if (RB_LEN(&tp->t_out) == 0)
goto out;
c = getc(&tp->t_out);
- /*tp->t_state |= TS_BUSY;*/
+ tp->t_state |= TS_BUSY; /* 21 Aug 92*/
splx(s);
sput(c, 0);
(void)spltty();
splx(s);
sput(c, 0);
(void)spltty();
+ tp->t_state &= ~TS_BUSY; /* 21 Aug 92*/
} while(1);
out:
splx(s);
} while(1);
out:
splx(s);