The Unix Heritage Society mailing list
 help / color / mirror / Atom feed
From: bsw@cuzuco.com (Brian S Walden)
Subject: [TUHS] Re: Patches to improve 6th Edition
Date: Sat, 28 Dec 2002 00:19:43 -0500	[thread overview]
Message-ID: <20021228051943.GA6817@panix.com> (raw)

Yes there are other bugs you will want to fix as well
if you are using v6 heavily and not on slow hardware
(e.g. a simulator).  In the inode allocation route
(ialloc()) in /usr/sys/ken/alloc.c there is a bug in
the placement of the loop: tag.  You just have to move
it up two line to above the while() loop. See the diff below.
This rare Ken Thompson bug was found in 1988 on an Amdahl UTS machine
that the hardware finally became fast enough that it caused us panics.
This bug existed from (at least) the Fifth up until the Eighth
editions from 1127 (BTL research). The Ninth edition had much
rewrites in the kernel and the algorthim was changed at that point.
Since it was in UTS, it must have been in the porting base of
System V Release 2. This code is the basis for the System V
filesystem, so it probably didn't exist in BSD releases
since they used their fast filesystem (cylinder groups, et al.)
which became UFS. It's amazing thet with the amount of eyes on it
(via Lions Commentary, etc.) it was not spotted earlier.

It would be good to get a collection of all "unreleased" bug fixes
that others may have.


*** alloc.c.orig        Fri Dec 27 23:23:30 2002
--- alloc.c     Fri Dec 27 23:23:30 2002
***************
*** 163,171 ****
        int i, j, k, ino;
  
        fp = getfs(dev);
        while(fp->s_ilock)
                sleep(&fp->s_ilock, PINOD);
- loop:
        if(fp->s_ninode > 0) {
                ino = fp->s_inode[--fp->s_ninode];
                ip = iget(dev, ino);
--- 163,171 ----
        int i, j, k, ino;
  
        fp = getfs(dev);
+ loop:
        while(fp->s_ilock)
                sleep(&fp->s_ilock, PINOD);
        if(fp->s_ninode > 0) {
                ino = fp->s_inode[--fp->s_ninode];
                ip = iget(dev, ino);


In article by Mirian Crzig Lennox:
> This reminds me that I fixed a couple of "bugs" (some outright bugs,
> and some mere behaviours which I didn't quite like) in playing with my
> V6/simh environment, and I'm wondering if there is a place I should
> submit them in case others might be interested.



             reply	other threads:[~2002-12-28  5:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-28  5:19 Brian S Walden [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-01-08 13:42 Norman Wilson
2002-12-28 20:38 Wolfgang Helbig
2002-12-28  8:33 Wolfgang Helbig
2002-12-28  7:07 Mike Haertel
2002-12-28  2:58 John Holden
2002-12-27 20:58 [TUHS] V6: 50 bugs tape Mirian Crzig Lennox
2002-12-27 21:55 ` [TUHS] Re: Patches to improve 6th Edition Warren Toomey
2002-12-28  2:43   ` Greg Haerr

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021228051943.GA6817@panix.com \
    --to=bsw@cuzuco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).