SCROLLING BACKWORDS ON CONSOLE CAUSES CRASH
authorFrank Maclachlan <fpm@crash.cts.com>
Fri, 21 Aug 1992 00:00:00 +0000 (00:00 +0000)
committerFrank Maclachlan <fpm@crash.cts.com>
Fri, 21 Aug 1992 00:00:00 +0000 (00:00 +0000)
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

usr/src/sys.386bsd/i386/isa/pccons.c

index cf50fb4..86da78e 100644 (file)
  * 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 $";
 
@@ -344,10 +351,11 @@ pcstart(tp)
        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);