Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site nmtvax.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!bellcore!decvax!genrad!panda!talcott!harvard!seismo!cmcl2!lanl!unmvax!unm-cvax!nmtvax!djm From: djm@nmtvax.UUCP Newsgroups: net.micro.apple Subject: A neat bug in Apple DOS Message-ID: <258@nmtvax.UUCP> Date: Thu, 7-Feb-85 16:02:26 EST Article-I.D.: nmtvax.258 Posted: Thu Feb 7 16:02:26 1985 Date-Received: Tue, 12-Feb-85 04:46:51 EST References: <126@nvuxd.UUCP> <> Reply-To: djm@nmtvax.UUCP (Dieter Muller) Organization: New Mexico Tech, Socorro Lines: 28 Keywords: Track/Sector Lists Summary:I discovered a neat little bug in DOS last night. Playing with a disk that had been munged a long while back (never had the time to fix it, it was only a game), I would be bouncing along (the game was Eamon) happily until, for no apparent reason, the head would start doing read seeks to two different sectors as fast as it could. Looked like a classic example of pointer A -> pointer B -> pointer A. Since this was the problem with the disk previously (as I belatedly remembered), I grabbed a disk dump routine and went hunting. After several colours of herring swam by, I realized two disgusting things. A) The file was random access, meaning that not all records were actually allocated. B) This file, due to its size, needed three TSLs, but only had two. Also, the missing TSL was the middle one (sectors 122-243). The bug : If the current TSL does not have a pointer to the needed sector, DOS will seek back to the first TSL and follow the links until it finds A) the desired TSL, or B) finds the end of the TSL list, in which case it seeks back to the first TSL and... (repeat ad infinitum). Share and Enjoy! Dieter Muller {lanl|unmvax}!nmtvax!djm