Subject: autoconfig can drop core (#87) Index: sys/autoconfig/read_dtab.c 2.11BSD Description: /etc/autoconfig can (depending on the number of devices, order of entries in /etc/dtab, etc) crash. This causes 'init' to leave the system in single user mode with no devices except the boot device and network devices configured. Repeat-By: Difficult to specify the exact order and number of devices in /etc/dtab which triggers the problem. This problem only occurs with the recent version of autoconfig (which passes vectors thru to drivers support programmable vectors). The bug was induced when an extra symbol (that of the 'xxVec' entry point for device 'xx') was added to the list of symbols read from the kernel symbol table. The space allocated for holding the 'nlist' results was not increased, causing autoconfig to over run a 'malloc'd memory area which in turn causes random crashes of the program. Fix: Apply the patch below to read_dtab.c. Recompile and install autoconfig. ===============================cut here================================= *** /sys/autoconfig/read_dtab.c.old Sat Dec 5 12:55:26 1987 --- /sys/autoconfig/read_dtab.c Tue Dec 8 20:12:30 1992 *************** *** 3,9 **** * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)read_dtab.c 1.1 (2.10BSD Berkeley) 12/1/86 */ #include --- 3,9 ---- * All rights reserved. The Berkeley software License Agreement * specifies the terms and conditions for redistribution. * ! * @(#)read_dtab.c 2.0 (2.11BSD GTE) 12/8/92 */ #include *************** *** 78,84 **** addent(&dp->dt_handlers,STRSAVE(save)); for (++cp;isspace(*cp);++cp); } ! guess_ndev += nhandlers + 2; for (up = uprobe;up->up_name;++up) if (!strcmp(dp->dt_name,up->up_name)) { dp->dt_uprobe = up->up_func; --- 78,92 ---- addent(&dp->dt_handlers,STRSAVE(save)); for (++cp;isspace(*cp);++cp); } ! guess_ndev += nhandlers; ! /* ! * In addition to the "handler" symbols for a device we need 3 more ! * symbols: 'xxVec', 'xxprobe', and 'xxattach'. ! * ! * N.B. If more symbols are added (to the 'DTAB' structure) the following ! * line may need to be modified. ! */ ! guess_ndec += 3; for (up = uprobe;up->up_name;++up) if (!strcmp(dp->dt_name,up->up_name)) { dp->dt_uprobe = up->up_func;