9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* bug in prog(3) and wm/deb [inferno]
@ 1996-09-27 16:04 rob
  0 siblings, 0 replies; 2+ messages in thread
From: rob @ 1996-09-27 16:04 UTC (permalink / raw)


a slightly less kludgy fix to wm/task.

wm% yesterday -d task.b
diff /n/dump/1996/0927/usr/inferno/appl/wm/task.b task.b
142c142
< 	if(v != 6)
---
> 	if(v < 6)
150a151,153
> 	# eat blanks in user name
> 	while(len l > 3)
> 		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);
> 			}




^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug in prog(3) and wm/deb [inferno]
@ 1996-09-27 14:44 Boyd
  0 siblings, 0 replies; 2+ messages in thread
From: Boyd @ 1996-09-27 14:44 UTC (permalink / raw)


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.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-09-27 16:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-09-27 16:04 bug in prog(3) and wm/deb [inferno] rob
  -- strict thread matches above, loose matches on Subject: below --
1996-09-27 14:44 Boyd

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).