BSD 4 development
[unix-history] / usr / news / v7bugs
CommitLineData
01af22f4
BJ
1From bill Thu Oct 18 01:41:53 1979
2To: v7bugs
3Subj: bug in icheck
4Cc: sklower
5
6there is a bug in the icheck program due to the declaration of
7 unsigned short s_fsize
8in <filsys.h>... in the places where XXX.s_fsize is used in comparisons
9in icheck.c, it should be cast to an integer. comparisons of the form
10 if (YYY < XXX.s_fsize)
11are deadly, since YYY may be negative. since XXX.s_fsize is positive,
12but signed, YYY is treated as unsigned, and havoc results from the fact
13that the comparsion fails. if an inode has a (bad) negative block
14number in it (YYY < 0) then icheck will (hopefully) core dump or screw
15up in some other way.
16 bill
17
18From bill Thu Oct 18 01:48:39 1979
19To: v7bugs
20
21the first set of fixes i sent around for the tty driver showed up further
22problems (e.g., now the tty driver hangs waiting for input on going into
23vi sometimes)... you should steal /usr/staff/ozalp/sys/sys/tty.c if you
24put in this first change and diff and take some more fixes. dmr thinks
25there may still be a problem with 0377's in raw input; if you are worried
26about this, change tty.c so that it always flushes if coming from/going
27to raw, i.e. no TIOCSETN for these transitions... no problem if you
28do this, i think
29
30From root Thu Oct 18 02:05:58 1979
31To: v7bugs
32
33s/s_fsize/s_isize/ in previous mail... sorry.
34
35From uucp Wed Sep 26 13:16:38 1979
36>From tom Tue Sep 25 22:01:30 1979 remote from ucsfcgl
37To: Bob Kridle, Ed Gould, Bill Joy
38Re: Bug in version 7 optimizer of dmr's pdp-11 compiler
39
40A bug involving unsigned integers has surfaced in the version 7 C compiler.
41After installing the following fix you should recompile:
42 mkfs.c
43 dcheck.c
44 passwd.c
45 getty.c
46 mail.c
47 pstat.c
48
49>From uucp Mon Jul 23 22:53:59 1979
50>From dmr Mon Jul 23 23:59:07 1979 remote from research
51Here is the change needed to fix the optimizer.
52The file is /usr/src/cmd/c/c21.c.
53This is in routine rmove, after case CBR, the first two
54lines in the 'if r==0' clause:
55
56190,191c
57< p->back->back->forw = p->forw;
58< p->forw->back = p->back->back;
59---
60> if (p->forw->op==CBR
61> || p->forw->op==SXT
62> || p->forw->op==CFCC) {
63> p->back->forw = p->forw;
64> p->forw->back = p->back;
65> } else {
66> p->back->back->forw = p->forw;
67> p->forw->back = p->back->back;
68> }
69
70The old code deleted a test or compare with constant operands
71and a following conditional branch that would always fail.
72The new code only deletes the branch (leaves the test)
73if the combination is followed by another instruction that
74needs the condition codes. The test and second branch are liable
75to be deleted later.
76
77
78From michael Mon Oct 29 20:26:58 1979
79To: v7bugs
80Subj: Tm.c
81
82There is a bug in the released version of V7 UNIX. The RLE bit (record
83length error) is defined wrong. You should
84/RLE/s/0100$/01000/
85asap
86The effect is that the bit which is selected is the select remote bit
87which is on when the drive is on line and all errors are effectively
88ignored (programs get a short write) and no retries are attempted.
89We have also upped the retry count (from 2) since our tape is behind two
90disk controers and doesn't always get the bus in time.
91
92From michael Wed Oct 31 19:44:55 1979
93To: v7bugs
94Subj: pcc
95
96we have a pile of fixes and/or bugs for the pdp-11 version of pcc
97if anyone is interested.
98
99From bill Mon Dec 31 14:37:09 1979
100To: v7bugs
101Subject: bug in exece()
102Cc: tbl jfr mhtsa!ted
103
104there is a nasty bug in exece() (which appeared in 50 changes)
105after the
106 bp = bread(swapdev, (daddr_t)(dbtofsb(swplo+bno)+(nc>>BSHIFT)));
107put
108 bp->b_flags &= ~B_DELWRI;
109else the buffer may stay in the cache with DELWRI set and clobber a
110random block in the swap area at some later time.
111
112From dmr Thu Jan 17 00:09:30 1980
113Forward to v7 bugs manager:
114The stand-alone boot loader for PDP-11 systems turns on
11522-bit addressing mode on 11/70's but does not set up the unibus
116map. Thus trying to boot on 11/70's with Unibus RP03's is a loss.
117Try booting V6 and don't turn the machine off.
118Failing that, set-em-up 1-1 by hand.
119
120From mark Fri Feb 15 21:43:11 1980
121To: v7bugs
122Subject: bugs in learn, tty driver
123Cc: gst
124"learn eqn" does a really horrible job of handling terminals that aren't dtc's.
125For starters, it seems to look for term (not TERM) in the environment, and then
126not do anything with it. But it does bomb out gracefully if term isn't set,
127or not gracefully if term is set to something nroff doesn't know about.
128It also behaves rather strangely if you set term=lpr and admit it didn't
129come out right.
130(Fix: change the learn shell script to use TERM instead of term. Change
131nroff so if the -T terminal doesn't exist it uses lpr. Fixed learn shell
132script available to anyone who's interested.)
133
134Learn editor has scripts that assume there is no "w" program. Since there
135does exist such a program (nonstandard except in VM/Unix) this example
136should be changed to use q.
137
138It does seem to be possible to learn eqn on a regular crt terminal by using
139 neqn file | nroff -ms | colcrt -2
140although this doesn't do anything about Greek letters.
141
142
143When you change your interrupt character from DEL to something else,
144the BREAK key still maps to DEL instead of interrupt. This is in
145dz.c et.al., and can be found by searching for DEL or 0177.
146The fix is to replace the 0177 by something like tun.c_intr;
147
148
149From root Wed Apr 16 20:04:20 1980
150To: v7bugs
151Subject: bug in /bin/time
152it prints null characters.
153what is needed is
154 if (c)
155before each (of 2)
156 fprintf(stderr,"%c",c);
157's
158 bill
159
160From mark Sat Apr 19 01:18:51 1980
161To: v7bugs
162Subject: bug in pdp-11 C optimizer
163The following program demonstrates a bug in the V7 pdp-11 /lib/c2.
164#include <stdio.h>
165main () {
166 int x;
167 int t1;
168
169 x = 0;
170 x += 1;
171 t1 = x != 1;
172 printf("x=%d, t1=%d\n", x, t1);
173 exit(0);
174}
175It should print 1, 0, but it prints 1, 1. Seems that the optimizer has
176correctly noticed that the value of x can be predicted at compile time
177and hence the comparison can be precomputed, but it does the precomputation
178wrong. Changing the 2 assignments to x to "x = 1" works properly.
179
180I don't know what the status of c2 is, I seem to recall someone telling me
181many years ago that c2 made certain mistakes and that some programs just
182couldn't be optimized. If this is the case you probably don't care about
183this, but if c2 is supposed to handle everything right, have fun.
184 Mark
185
186From bill Thu May 15 16:27:26 1980
187To: v7bugs
188
189the fileno macro omits parenthesization, i.e. it reads
190 #define fileno(p) p->_file
191it should be defined as
192 #define fileno(p) (p)->_file
193
194From mark Wed May 21 13:11:49 1980
195To: v7bugs
196Subject: stdio fileno bug
197
198 From uucp Wed May 21 04:17:22 1980
199 >From daemon Tue May 20 23:36:57 1980 remote from vax135
200 >From uucp Tue May 20 21:23:42 1980 remote from duke
201 >From smb Tue May 20 21:17:24 1980 remote from unc
202 Your redefinition of fileno to fix the bug is wrong; it should be
203
204 #define fileno(p) ((p)->file)
205
206
207
208
209I fixed this on Ernie.
210 Mark
211
212From mark Tue May 27 23:34:24 1980
213To: research!dan v7bugs wh5ess!ber
214Subject: fix to uux bug
215Cc: wh5ess!teklabs!clemc wh5ess!uwvax!bob
216
217A bug in uux prevents the - option from working with binary files.
218To fix it, in uux.c, search for "fputs". (It's in an if (pipein) {.)
219replace the fgets/fputs loop by
220 while ((c = getc(stdin)) != EOF)
221 putc(c, fpd);
222and declare c somewhere to be an int. (I put the line
223 register int c;
224right after the if (pipein).)
225
226Fixing this bug will allow the new uusend program, which will be released
227shortly, to work, allowing the transfer of binary files across indirect
228uucp links.
229
230(I don't know where dan's home machine is, would someone please let
231him know about this?)
232
233 Mark
234
235From michael Wed Jun 4 18:21:35 1980
236To: v7bugs
237Subject: Adb
238
239I have found two bugs in Adb (on the 11 at least)
240First I think the floating point registers are not collected properly,
241we have no floating point so I havent checked. It looks to me like
242"readregs" in runpcs.c gets the 25 BYTES starting at u.u_fpsr rather
243than the 25 words. Those without an fp unit might want to comment
244that section out anyway and make break pointing run faster.
245Second in runpcs (same file) the line which has the following fragment:
246 ... BKPTEXEC, command(bkpt->comm,':')) .....
247should be:
248 ... BKPTEXEC, !command(bkpt->comm,':')) ....
249This causes the count in the break point to be used.
250Also anyone who has a method of translating adb into readable 'C' should
251get a prize.
252
253From michael Mon Jun 9 09:02:14 1980
254To: ucsfcgl!tom
255Cc: v7bugs
256
257What I should have said about the fp registers is that it is fetching
25825 words at 25 byte addresses. I think that the ptrace call
259sould be:
260 ptrace(RUREGS,pid,i*2,0) OD
261
262From Cory:root Wed Jun 25 18:17:42 1980
263To: kridle
264Cc: v:v7bugs
265
266Bob,
267I fixed a bug in trap.c that I found when installing V7 on the 11/45.
268The case1+USER fuiword should be ((caddr_t)pc-2) and not ((caddr_t)(pc-2)).
269You might want to forward this to others who might be interested.
270 jeff
271
272
273From Cory:len Sat Jun 28 13:44:33 1980
274To: v:v7bugs
275
276 From root Wed Jun 25 18:14:05 1980
277 To: kridle
278 Cc: v:v7bugs
279
280 Bob,
281 I fixed a bug in trap.c that I found when installing V7 on the 11/45.
282 The case1+USER fuiword should be ((caddr_t)pc-2) and not ((caddr_t)(pc-2)).
283 You might want to forward this to others who might be interested.
284 jeff
285
286
287
288From uucp Sun Jul 20 07:06:17 1980
289>From daemon Sun Jul 20 02:28:59 1980 remote from ucsfcgl
290>From rusty Fri Jul 18 20:23:26 1980 remote from cmevax
291To: ucsfcgl!ucbvax!v7bugs
292Subject: learn bug
293
294In file dounit.c insert before the "goto retry;" "fclose(scrin);" otherwise
295you can run out of file descriptors if you goto retry enough times, and one
296of the fclose's will produce a core.
297
298
299
300From michael Fri Aug 29 14:54:47 1980
301To: v7bugs
302Subject: unix on 11/70's with unibus disks
303
304Unix as released cannot run on an 11/70 without a massbus disk.
305A change to the standalone boot code and to UNIX itself is necessary
306for this to work. In standalone/M.s simply change the code so it
307does not enable the unibus map:
308< mov $65,SSR3 /* 22-bit, map, K+U sep */
309-----
310> mov $45,SSR3 /* 22-bit, K+U sep */
311
312This will allow the system to boot. But strange things happen when
313you do raw I/O on a unibus disk.
314
315In conf/mch.s before:
316 bit $20,SSR3
317add:
318 mov $65,SSR3
319
320There is similar code farther down, but I think that it doesnt get
321executed....
322 mike
323
324From ESVAX:jimbo Wed Sep 17 01:29:39 1980
325To: v:v7bugs
326Subject: "last" catches interrupts
327
328when forked into the background.
329
330
331From bill Wed Sep 17 11:56:45 1980
332To: ESVAX:jimbo v7bugs
333Subject: "last" catches interrupts
334
335there is a cleaned up last in /usr/src/new on csvax.
336 bill
337
338From mhtsa!mp Wed Sep 24 06:53:45 1980
339To: ucbvax!v7bugs
340Subject: floating point bugs
341Cc: mp
342
343You may have heard of these bugs before (the following is quoted verbatim
344from Vrije Universiteit's Pascal-VU package, which has been around for awhile),
345yet I find that USG's UNIX still has them...
346
347Floating point registers
348
349 When a program is swapped to disk if it needs more
350 memory, then the floating point registers were not
351 saved, so that it may have different registers when it
352 is restarted. A small assembly program demonstrates
353 this for the status register. If the error is not
354 fixed, then the program generates an IOT error. A
355 "memory fault" is generated if all is fine.
356
357 start: ldfps $7400
358 1: stfps r0
359 mov r0,-(sp)
360 cmp r0,$7400
361 beq 1b
362 4
363
364 You have to dig into the kernel to fix it. The
365 following patch will do:
366
367 /* original /usr/sys/sys/slp.c */
368
369 563 a2 = malloc(coremap, newsize);
370 564 if(a2 == NULL) {
371 565 xswap(p, 1, n);
372 566 p->p_flag |= SSWAP;
373 567 qswtch();
374 568 /* no return */
375 569 }
376
377 /* modified /usr/sys/sys/slp.c */
378
379 590 a2 = malloc(coremap, newsize);
380 591 if(a2 == NULL) {
381 592 #ifdef FPBUG
382 593 /*
383 594 * copy floating point register and status,
384 595 * but only if you must switch processes
385 596 */
386 597 if(u.u_fpsaved == 0) {
387 598 savfp(&u.u_fps);
388 599 u.u_fpsaved = 1;
389 600 }
390 601 #endif
391 602 xswap(p, 1, n);
392 603 p->p_flag |= SSWAP;
393 604 qswtch();
394 605 /* no return */
395 606 }
396
397
398Floating point registers.
399
400 A similar problem arises when a process forks. The
401 child will have random floating point registers as is
402 demonstrated by the following assembly language
403 program. The child process will die by an IOT trap and
404 the father prints the message "child failed".
405
406 exit = 1.
407 fork = 2.
408 write = 4.
409 wait = 7.
410
411 start: ldfps $7400
412 sys fork
413 br child
414 sys wait
415 tst r1
416 bne bad
417 stfps r2
418 cmp r2,$7400
419 beq start
420 4
421 child: stfps r2
422 cmp r2,$7400
423 beq ex
424 4
425 bad: clr r0
426 sys write;mess;13.
427 ex: clr r0
428 sys exit
429
430 .data
431 mess: <child failed\n>
432
433 The same file slp.c should be patched as follows:
434
435 /* original /usr/sys/sys/slp.c */
436
437 499 /*
438 500 * When the resume is executed for the new process,
439 501 * here's where it will resume.
440 502 */
441 503 if (save(u.u_ssav)) {
442 504 sureg();
443 505 return(1);
444 506 }
445 507 a2 = malloc(coremap, n);
446 508 /*
447 509 * If there is not enough core for the
448 510 * new process, swap out the current process to generate the
449 511 * copy.
450 512 */
451
452 /* modified /usr/sys/sys/slp.c */
453
454 519 /*
455 520 * When the resume is executed for the new process,
456 521 * here's where it will resume.
457 522 */
458 523 if (save(u.u_ssav)) {
459 524 sureg();
460 525 return(1);
461 526 }
462 527 #ifdef FPBUG
463 528 /* copy the floating point registers and status to child */
464 529 if(u.u_fpsaved == 0) {
465 530 savfp(&u.u_fps);
466 531 u.u_fpsaved = 1;
467 532 }
468 533 #endif
469 534 a2 = malloc(coremap, n);
470 535 /*
471 536 * If there is not enough core for the
472 537 * new process, swap out the current process to generate the
473 538 * copy.
474 539 */
475
476
477From ESVAX:asa Wed Sep 24 13:34:03 1980
478To: v:v7bugs
479Subject: as: Symbol table overflow
480
481I have gotten a complaint from a user trying to compile a fortran
482program. The assembler complains about symbol table overflow.
483What can be done about it? What is the size of the symbol table?
484
485
486From bill Wed Sep 24 16:02:10 1980
487To: ESVAX:asa v7bugs
488Subject: as: Symbol table overflow
489
490this will be fixed in the next release of the system.
491for the time being he should break up the program into pieces.
492(there is no fixed limit on symbol table size in the next releasre)
493