9fans archive / 1996 / 09 / 53 / prev next
From: Boyd Roberts boyd@fra...
Subject: bug in prog(3) and wm/deb [inferno]
Date: Fri, 27 Sep 1996 16:44:52 +0200
i've found a bug in the prog file-system on windows '95.
what i see is 7 fields and not 6 when i cat /prog/n/status:
$ cat /prog/1/status
1 1 BOYD ROBERTS release 1K Sh[$Sys]
it's the space the user name that breaks things.
in turn this breaks wm/deb. i've hacked in a kludge and at the same
time i've fixed a problem with it indirecting though nil:
142c142,143
< if(v != 6)
---
> # kludge around problem with space in user name
> if(v != 6 && v !=7)
150a152,153
> if (v == 7)
> l = tl l;
177c180
< if(p != nil)
---
> if(p != nil) {
179,180c182,184
< l := sys->sprint("%4d %3dK %-7s |%s", p.pid, p.size, p.state, p.mod);
< tk->cmd(t, ".fl.l insert end '"+l);
---
> l := sys->sprint("%4d %3dK %-7s |%s", p.pid, p.size, p.state, p.mod);
> tk->cmd(t, ".fl.l insert end '"+l);
> }
looking at the code fragment it strikes me that the compiler could
detect the use of a nil pointer by marking the variable as poisoned
in the nil value code path and then future references give errors.
btw: i really like wm/deb.