home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / bsd / 3165 < prev    next >
Encoding:
Internet Message Format  |  1992-07-29  |  2.7 KB

  1. Path: sparky!uunet!wupost!sdd.hp.com!uakari.primate.wisc.edu!ames!agate!linus!linus.mitre.org!heckle!wheeler
  2. From: wheeler@heckle.mitre.org (Brien L. Wheeler)
  3. Newsgroups: comp.unix.bsd
  4. Subject: 386BSD Bug in wd.c
  5. Keywords: wd.c malloc bzero
  6. Message-ID: <1992Jul30.024553.2340@linus.mitre.org>
  7. Date: 30 Jul 92 02:45:53 GMT
  8. Sender: wheeler@heckle (Brien L. Wheeler)
  9. Organization: The MITRE Corporation, Bedford, MA
  10. Lines: 76
  11. Nntp-Posting-Host: heckle.mitre.org
  12.  
  13. I sent this bug report off to Lynne Jolitz tonight.  Some non-initialized
  14. memory in wd.c prevents my machine from warm-rebooting.  Trivial context
  15. diff attached.
  16.  
  17. The system really looks great -- thanks Bill and Lynne!
  18. -----
  19.  
  20. BUG FINDER INFORMATION
  21.  
  22. NAME:    Brien L. Wheeler
  23. TITLE:   Technical Staff
  24. FIRM:    The MITRE Corporation
  25. ADDRESS: Mail Stop K331
  26.          202 Burlington Road
  27.          Bedford, MA  01730
  28. COUNTRY: USA
  29. PHONE:   617-271-2567
  30. FAX:     617-271-2352
  31. EMAIL:   blw@mitre.org
  32.  
  33.  
  34. PC INFORMATION
  35.  
  36. 1.   What  is  your  PC    system    configuration?    Please    be
  37.      specific,    as  success  can  vary    with a difference in
  38.      manufacture date or variation.
  39.  
  40.      386/486/387:             Zenith Z-386 (386 + 387) (16 MHz?)
  41.      ISA/EISA/SCSI:           ISA
  42.      RAM size:                5 MB
  43.      drive(s) type and size:  Winchester 80 MB (Seagate?)
  44.                                   Winchester 40 MB (Seagate?)
  45.      tape(s) type and size:   None
  46.      ethernet type:           WD 8013 Elite
  47.      graphics type:           VGA
  48.      serial type:
  49.      parallel type:
  50.      other:                   None
  51.  
  52.  
  53. Bugs
  54.  
  55. 1.   What bugs have you found in this system? Please  attach
  56.      any  pertinent  printouts    and  system messages. Please
  57.      also attach any bug fixes for others to use.
  58.  
  59.  
  60. In usr/src/sys.386bsd/i386/isa/wd.c, the memory malloc'd for a
  61. new struct disk in wdprobe() is not bzero'd before its use.  On
  62. my machine, this prevents a warm reboot -- malloc grabs the same
  63. memory as the previous boot sequence, and sees the disk as
  64. already open (du->dk_state == 3).  This causes wdsize() to return
  65. a -1 to swapconf() (since dk_state is not zero the wdopen() is not
  66. called, leaving val uninitialized, resulting in a return code of -1).
  67. This screws everything up royally.  The fix is easy -- bzero the
  68. memory malloc'd in wdprobe().  Context diff follows.
  69.  
  70. -----
  71. *** wd.c.orig    Tue Jul 14 20:55:21 1992
  72. --- wd.c    Wed Jul 29 22:33:58 1992
  73. ***************
  74. *** 149,154 ****
  75. --- 149,155 ----
  76.       if ((du = wddrives[unit]) == 0) {
  77.           du = wddrives[unit] = (struct disk *)
  78.               malloc (sizeof(struct disk), M_TEMP, M_NOWAIT);
  79. +         bzero(du, sizeof(*du));
  80.           du->dk_unit = unit;
  81.       }
  82.  
  83.  
  84. -- 
  85.      Brien L. Wheeler  |  I don't speak for MITRE, and they
  86.      blw@mitre.org     |  don't speak for me.
  87.  
  88. "When I think back on all the crap I learned in high school..."
  89.