Subject: fp simulator kernel crash, tcsh here doc crash, welcome y2k bug Index: src/sys/pdp/mch_fpsim.s, src/bin/tcsh/(sh.glob.c,sh.dol.c,sh.decls.h), src/local/welcome/welcome.c Description: Using the Floating Point simulation will crash the kernel when a signal (SIGTRAP, SIGILL, SIGFPE) needs to be generated. tcsh will crash when using a 'here document'. There is a year 2000 (y2k) bug in the 'welcome' program. Repeat-By: 1. Have a PDP-11 without floating point harware (but otherwise still capable of running 2.11BSD) and execute a floating point instruction with an invalid opcode (SIGILL), invalid / inaccessible data (SIGSEGV), or (SIGTRAP) The problem is that the signal names created during the kernel build process (by the 'genassym' helper program) have a '.' appended. So the signal name SIGILL (which has the value of 4) is given the value of 4. In mch_fpsim.s This analysis is courtesy of Dr. Walter F.J. Mueller: mov $SIGILL.,r0 becomes mov $4..,r0 the assembler https://wolfram.schneider.org/bsd/7thEdManVol2/assembler/assembler.pdf 6.1 Expression operators. The operators are: (blank) when there is no operand between operands, the effect is exactly the same as if a + had appeared. So the lexer sees two tokens $4. --> number . --> symbol for location counter and because the default operator is '+' interprets this as mov $4. + . , r0 which ends up being a number in the 160000 to 177777 range. And that causes a crash. 2. Use a 'here document' and tcsh will crash: cat < #include #include *************** *** 123,130 **** x = 40 - (strlen(days[det->tm_wday]) / 2); y = (69 - x); printf("\033[8;%dH%s", y, days[det->tm_wday]); ! sprintf(bot, "%s %d, 19%d %d:%02d %cM", mons[det->tm_mon], ! det->tm_mday, det->tm_year, det->tm_hour, det->tm_min, ap); a = 40 -(strlen(bot) / 2); b = (54 - a); --- 129,136 ---- x = 40 - (strlen(days[det->tm_wday]) / 2); y = (69 - x); printf("\033[8;%dH%s", y, days[det->tm_wday]); ! sprintf(bot, "%s %d, %d %d:%02d %cM", mons[det->tm_mon], ! det->tm_mday, det->tm_year+1900, det->tm_hour, det->tm_min, ap); a = 40 -(strlen(bot) / 2); b = (54 - a); *** VERSION.old Sat Apr 27 08:42:59 2019 --- VERSION Fri Oct 11 12:34:04 2019 *************** *** 1,5 **** ! Current Patch Level: 452 ! Date: April 27, 2019 2.11 BSD ============ --- 1,5 ---- ! Current Patch Level: 453 ! Date: October 11, 2019 2.11 BSD ============