Larn bug on AT&T Unix-pc does anyone have a fix
Ken Arnold%CGL
arnold at socrates.ucsf.edu
Thu Aug 28 17:20:15 AEST 1986
In article <794 at Shasta.STANFORD.EDU> kaufman at Shasta.UUCP (Marc Kaufman) writes:
>In article <89 at rayssd.UUCP> dpw at 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
More information about the Comp.sources.bugs
mailing list