Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!Mike.Accetta@cmu-cs-ius From: Mike.Accetta@cmu-cs-ius@sri-unix.UUCP Newsgroups: net.unix-wizards Subject: 4.1BSD exec() bug Message-ID: <4190@sri-arpa.UUCP> Date: Sat, 13-Aug-83 20:43:34 EDT Article-I.D.: sri-arpa.4190 Posted: Sat Aug 13 20:43:34 1983 Date-Received: Mon, 15-Aug-83 01:24:58 EDT Lines: 23 In 4.1BSD the getxfile() routine in module sys1.c contains a test against executing a shareable text image which is open for writing. In our version of the system (and some others I've seen recently) the test line reads if (fp->f_inode == ip && (fp->f_flag&FWRITE)) { while it should really be something like if (fp->f_count && fp->f_inode == ip && (fp->f_flag&FWRITE)) { so that the file table entry is not considered when not in use. The symptom of this bug is occasional mysterious and usually non-repeatable "text file busy" error messages when trying to execute a program. These will occur whenever the system makes the check (which is not necessarily very often given the preceding tests) and the inode slot of the program was previously used for a file open for writing and its corresponding entry in the file table has yet to be reallocated. This bug appears to have been fixed in versions of 4.1c I've seen. - Mike Accetta