Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!brutus.cs.uiuc.edu!apple!sun-barr!texsun!letni!sneaky!gordon From: gordon@sneaky.UUCP (Gordon Burditt) Newsgroups: comp.sources.games.bugs Subject: Re: NetHack 3 strange abort Message-ID: <17082@sneaky.UUCP> Date: 6 Sep 89 16:42:39 GMT References: <178@bmers58.UUCP> <74@tor.nhh.no> Reply-To: gordon@sneaky.UUCP (Gordon Burditt) Organization: Gordon Burditt Lines: 49 >> No. That was one of the first things I thought of. It simply dies. The prompt >> appears in the middle of the screen (it does not clear the screen like when I >> hit the '!' key) and I do a ps to find that this is indeed my login shell. > >I've seen similar behaviour, except that Xenix says 'Illegal >instruction'. Again, it happens only during fights. Anyone? I partly tracked this down on a friend's 386 Xenix machine. The illegal instruction is really "mod by zero" in rnd(), because rnd(0) was called from newexplevel(). It (almost) always happens in fights because killing a monster is the primary way of gaining experience to go up a level. This doesn't make any sense, though, because for rnd(0) to be called, SPELLS has to be configured, and WIS has to be negative. As shown on the screen, it wasn't even close to negative, and the game isn't supposed to allow it below 3. There may be wisdom-draining monsters, but not this early in the dungeon. I stuck code into rnd() similar to: if (x == 0) { pline("Some bozo code called rnd(0) again"); return 1; } along with some debugging code to print WIS. This prevents crashing the game but doesn't hide the problem. Debug printouts of WIS before and after indicate it's perfectly normal. Versions & other stuff: It bombs on 386 Xenix (not sure which version), Nethack 3.0, patchlevels 0, 1, and 2, and generally takes less than 20 minutes for my friend to demonstrate on request. It does NOT bomb on 68000 Xenix (int = 32 bits, if that's relevant), Nethack 3.0, patchlevels 0, 1, and 2, in spite of too much time playing the game. Minimal changes were made to the source on both systems. The special features that take memory were left in. Both systems are more-or-less "System V". About the most serious change was taking out the declaration of sprintf(), since it conflicted with include files, and changing the suffix assumed to be used by compress to match the version on my system. Gordon L. Burditt ...!texbell!sneaky!gordon