home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / bsd / 4700 < prev    next >
Encoding:
Text File  |  1992-08-25  |  2.0 KB  |  67 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!sdd.hp.com!usc!sol.ctr.columbia.edu!ucselx!crash!fpm
  3. From: fpm@crash.cts.com (Frank Maclachlan)
  4. Subject: 386BSD 0.1 pccons bug crashes system (w/ fix)
  5. Organization: CTS Network Services (crash, ctsnet), El Cajon, CA
  6. Date: 24 Aug 92 17:44:42 PDT
  7. Message-ID: <1992Aug24.174443.22587@crash>
  8. Followup-To: comp.unix.bsd
  9. Keywords: 386BSD pccons
  10. Lines: 55
  11.  
  12. Greetings:
  13.  
  14. I was horrified whilst scrolling backwards in a file with the less
  15. pager at my console when my 386BSD system suddenly rebooted.
  16. Subsequent tests revealed that the system would crash whenever I
  17. scrolled rapidly backwards through this file using less.
  18.  
  19. Most files won't cause the system to crash.  To demonstrate the failure,
  20. do the the following (if you don't mind watching your system crash):
  21.  
  22.     hd /usr/mdec/bootwd >junk    # create a file
  23.     less junk            # invoke less
  24.     G                # go to the end of the file
  25.     ^B^B^B...            # rapid repeated control B's to
  26.                     #  scroll backwards
  27.  
  28. If you are running the standard console driver ('/sys/i386/isa/pccons.c'),
  29. the system will probably crash.
  30.  
  31. The problem is caused by sput() in pccons being reentered while
  32. processing escape sequences.  Sput(), however, is not reentrant; in
  33. this particular case, the parameter to the scroll down code was being
  34. modified resulting in the kernel being scrolled down (or somewhere).  :-(
  35.  
  36. My probably non-optimal fix to '/sys/i386/isa/pccons.c' is given below:
  37.  
  38.  
  39. *** pccons.c.ORIG    Mon Aug 24 18:09:23 1992
  40. --- pccons.c    Mon Aug 24 18:12:28 1992
  41. ***************
  42. *** 344,353 ****
  43.       if (RB_LEN(&tp->t_out) == 0)
  44.           goto out;
  45.       c = getc(&tp->t_out);
  46. !     /*tp->t_state |= TS_BUSY;*/
  47.       splx(s);
  48.       sput(c, 0);
  49.       (void)spltty();
  50.       } while(1);
  51.   out:
  52.       splx(s);
  53. --- 344,354 ----
  54.       if (RB_LEN(&tp->t_out) == 0)
  55.           goto out;
  56.       c = getc(&tp->t_out);
  57. !     tp->t_state |= TS_BUSY;
  58.       splx(s);
  59.       sput(c, 0);
  60.       (void)spltty();
  61. +     tp->t_state &= ~TS_BUSY;
  62.       } while(1);
  63.   out:
  64.       splx(s);
  65.  
  66. -- Frank MacLachlan
  67.