[comp.sources.bugs] Nethack

nelson@ecsvax.UUCP (jim nelson) (08/11/87)

Sorry for re-posting instead of posting to both groups first time.
I'm new.  But here goes:

I have modified nethack to run under a compiler that does not
support functions returning structures; and made a couple of
"my compiler chokes on this complicated line" changes.
The system is Genix (BSD 4.1, yes 4.1, based) on a
LMC Megamicro box. NS16032 (well, that's what they called it then)
based.  I will mail diffs to anyone interested.
-- 
Jim Nelson, UNC-Wilmington/CS Dept.(919) 395-3300 
Wilmington NC 28403
usenet/bitnet: nelson@ecsvax

jon@gaia.UUCP (Jonathan Corbet) (12/16/87)

I managed to build hack on my (Microport) system with no real trouble.  It
seems to run pretty well, for the most part.  However, the dungeon seems
to be very empty!  I don't find any of the neat sorts of things that I
used to -- no food, no scrolls, no nothing, except for monsters and fountains.
Am I the only one to see this behavior?  This isn't a feature, I hope?

jon

rick@pcrat.UUCP (Rick Richardson) (12/17/87)

In article <338@gaia.UUCP> jon@gaia.UUCP (Jonathan Corbet) writes:
>I managed to build hack on my (Microport) system with no real trouble.  It
>seems to run pretty well, for the most part.  However, the dungeon seems
>to be very empty!  I don't find any of the neat sorts of things that I
>used to -- no food, no scrolls, no nothing, except for monsters and fountains.
>Am I the only one to see this behavior?  This isn't a feature, I hope?

I noticed this one with VENIX 2.3 on the AT, which has the AT&T compiler
as Microport does.

Wiz mode and a potion of object detection revealed that all the objects
were up on the first line of the screen.  Not too accessable there!!!
There's some trouble with the somex() and somey() macros in mklev.c
and this compiler, I believe.  Haven't had time to track it down,
since Nethack 2.2 is working fine for me on the VAX.
-- 
	Rick Richardson, President, PC Research, Inc.
(201) 542-3734 (voice, nights)   OR   (201) 834-1378 (voice, days)
		seismo!uunet!pcrat!rick

jona@moss.ATT.COM (12/17/87)

I ran lint on nethack and came up with an interesting potential bug -

BLINDFOLDED is defined as LAST_RING+11
Blindfolded is defined as u.uprops[BLINDFOLDED].p_flgs

*and*
uprops is struct prop uprops[LAST_RING+11].

As far as I can see this is addressing one past the end of the uprops array
which should cause blindfolds to be screwed up. Has anyone had trouble with
blindfolds? should uprops be size LAST_RING+12?

----
Jon M. Allingham	(201)386-3637	AT&T Bell Laboratories (Whippany,NJ)
{ihnp4,clyde}!moss!jona			WH 1A-114

"To those of us with real understanding, dancing is the only pure art form"
-Snoopy 

dave@umbc3.UMD.EDU (David A Freeman) (12/20/87)

In article <18633@clyde.ATT.COM> jona@moss.UUCP (Jon M. Allingham) writes:
>
>I ran lint on nethack and came up with an interesting potential bug -
>
>BLINDFOLDED is defined as LAST_RING+11
>Blindfolded is defined as u.uprops[BLINDFOLDED].p_flgs
>
>*and*
>uprops is struct prop uprops[LAST_RING+11].
>
>As far as I can see this is addressing one past the end of the uprops array
>which should cause blindfolds to be screwed up. Has anyone had trouble with
>blindfolds? should uprops be size LAST_RING+12?

	I found it quite easy to crash the game using the blindfold.

	Just get into wizard mode and teleport to hell with the blindfold on.

	Then start to search the level. You should get the message

	" At get null a 00 00 " which will soon be followed by a segmentation

	fault.  I think saving the game prevents the crash.  If you don't

	get the "at gets null" message start moving up levels with the 

	blindfold on. It will happen sooner or later. Could someone post

	a patch for this?




						dave



arpa:	dave@umbc3.umd.edu
bitnet  dave@umbc2

allbery@ncoast.UUCP (Brandon Allbery) (12/24/87)

As quoted from <437@pcrat.UUCP> by rick@pcrat.UUCP (Rick Richardson):
+---------------
| In article <338@gaia.UUCP> jon@gaia.UUCP (Jonathan Corbet) writes:
| >I managed to build hack on my (Microport) system with no real trouble.  It
| >seems to run pretty well, for the most part.  However, the dungeon seems
| >to be very empty!  I don't find any of the neat sorts of things that I
| 
| I noticed this one with VENIX 2.3 on the AT, which has the AT&T compiler
| as Microport does.
| Wiz mode and a potion of object detection revealed that all the objects
| were up on the first line of the screen.  Not too accessable there!!!
+---------------

Check the definition of rnd().  Some work was done to make it use lrand48(),
but it was botched and the code ends up calling rand() in such a way as to
produce some possibly worthless values.  I don't remember which source files
were affected.
-- 
	      Brandon S. Allbery, Moderator of comp.sources.misc
 {hoptoad,harvard!necntc,cbosgd,sun!mandrill!hal,uunet!hnsurg3}!ncoast!allbery
     [This space reserved for future quotes and similar brain twisters.]