Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!ucsfcgl!arnold From: arnold@socrates.ucsf.edu (Ken Arnold%CGL) Newsgroups: net.sources.bugs Subject: Re: Larn bug on AT&T Unix-pc does anyone have a fix Message-ID: <9933@cgl.ucsf.edu.ucsfcgl.UUCP> Date: Thu, 28-Aug-86 03:20:15 EDT Article-I.D.: cgl.9933 Posted: Thu Aug 28 03:20:15 1986 Date-Received: Fri, 29-Aug-86 01:23:25 EDT References: <89@rayssd.UUCP> <794@Shasta.STANFORD.EDU> Sender: daemon@ucsfcgl.UUCP Reply-To: arnold@socrates.ucsf.edu.UUCP (Ken Arnold%CGL) Distribution: net Organization: Computer Graphics Laboratory, UCSF Lines: 36 In article <794@Shasta.STANFORD.EDU> kaufman@Shasta.UUCP (Marc Kaufman) writes: >In article <89@rayssd.UUCP> dpw@rayssd.UUCP (Darryl P. Wagoner) writes: >>On both larn11.0 and larn12.0 I have ran across this bug >>where in casting spells like "lit" it will get hung in >>loop... >Look at 'godirect' (in monster.c) and 'napms' (the sleep/delay routine). >I ran into a problem with sending the wrong size parameter (short vs. long) >to the napms routine, because on my machine ints are 16 bits. >The system hangs up waiting an arbitrarily long period of time.. It's worse than that. The code for SYSV namps() is something like the following: get current time figure out the future time which is the current time + delay while (time to stop < current time) continue; return Well, that loop should be while (time to stop > current time) continue; This fails harmlessly as long as "time to stop" is greater than the current time at the start of the loop. However, the delay for the "lit" spell is so small that it is quite possible (quite probable, actually) that the current time at the start of the loop is later than the expected time to stop. Which means the loop goes on forever. Which is your bug, even after the short vs. long type problem. I tried to send this bug to the author and/or his friend and found myself singularly unsuccessful in reaching either one. Would either of them like to mail me a note? I have some other useful fixes ... Ken Arnold