[comp.sources.games.bugs] Nethack 3.0 under V/AT 2.3

sjb@dalek.UUCP (Seth J. Bradley) (09/14/89)

I have tried everything I can think of to get Nethack
to run without crashing, but at least every other game
ends with:

 Suddenly, the dungeon collapses.
nethack: IOT trap - Core dumped

I can't figure out what is causing this - please help!
Thanks in advance!

-- 
Seth J. Bradley     UUCP: uunet!{lll-winken|zorch}!dalek!sjb
		Internet: lll-winken.llnl.gov!dalek!sjb

root@nadia.UUCP (Eddy Schmidt) (09/15/89)

In article <8@dalek.UUCP> sjb@dalek.UUCP (Seth J. Bradley) writes:
>I have tried everything I can think of to get Nethack to run without
>crashing, but at least every other game ends with:

> Suddenly, the dungeon collapses.
>nethack: IOT trap - Core dumped

So thats like my problem, the games crashes down after a few minutes,
the error-message is : Memory fault.
I'm running an AT-Clone with Microport SYSV AT 286 V2.4
Please someone can help me !
Greets,

-- 
Eddy Schmidt            | usenet: ..uunet!unido!nadia!eddy   bix:eddi
Klingenstr.29           | Mailbox: *49 711 484464   24 h   1200/2400 Baud
D-7000 Stuttgart 1      |          *49 711 461592   24 h   1200/2400 Baud
Tel.: *49 711 485840    | Beware of programmers who carry screwdrivers !!

wietse@wzv.win.tue.nl (Wietse Z. Venema) (09/15/89)

sjb@dalek.UUCP (Seth J. Bradley) writes:

>I have tried everything I can think of to get Nethack
>to run without crashing, but at least every other game
>ends with:

> Suddenly, the dungeon collapses.
>nethack: IOT trap - Core dumped

Try compiling without the -O option :-)

sjb@dalek.UUCP (Seth J. Bradley) (09/15/89)

In article <326@wzv.win.tue.nl> wietse@wzv.win.tue.nl (Wietse Z. Venema) writes:
>sjb@dalek.UUCP (Seth J. Bradley) writes:
>> Suddenly, the dungeon collapses.
>>nethack: IOT trap - Core dumped
>
>Try compiling without the -O option :-)

I never use the -O option for anything with an executable over
64KB.  Has anyone else gotten this to run under V/AT 2.3?
I'd like to see their config.h and unixconf.h files!



-- 
Seth J. Bradley     UUCP: uunet!{lll-winken|zorch}!dalek!sjb
		Internet: lll-winken.llnl.gov!dalek!sjb

wietse@wzv.win.tue.nl (Wietse Z. Venema) (09/16/89)

I wrote:

>Try compiling without the -O option :-)

sjb@dalek.UUCP (Seth J. Bradley) writes:

>I never use the -O option for anything with an executable over
>64KB.  Has anyone else gotten this to run under V/AT 2.3?
>I'd like to see their config.h and unixconf.h files!

Ok, to bring this discussion to an end, these are the changes I
made to get nethack3.0, patchlevel 3 running under SV/AT 2.3.0-L.

The Makefile.src refers to an xmalloc library.  This is a malloc
implementation I got from Charles Hedrick.  I often use that one because
it greatly reduces the amount of sbrk() system calls (and hence, the
amount of swapping activity).  A more important feature may be that this
allocator rounds up the requested number of bytes to the nearest power
of two.  That may make programs more tolerant for writing beyond the end
allocated memory than if one would use the standard malloc()
implementation.

So, if my changes alone do not solve your problems, contact me and I
will mail the source to the xmalloc library.

*** ./include/unixconf.h-	Fri Sep  8 23:12:55 1989
--- ./include/unixconf.h	Fri Sep  8 23:29:44 1989
***************
*** 21,30 ****
  
  /* #define BSD		/* define for 4.n BSD  */
  			/* also for relatives like SunOS */
! #define ULTRIX		/* define for Ultrix v3.0 or higher (but not lower) */
  			/* Use BSD for < v3.0 */
  			/* "ULTRIX" not to be confused with "ultrix" */
! /* #define SYSV		/* define for System V */
  /* #define NETWORK	/* if running on a networked system */
  			/* e.g. Suns sharing a playground through NFS */
  
--- 21,30 ----
  
  /* #define BSD		/* define for 4.n BSD  */
  			/* also for relatives like SunOS */
! /* #define ULTRIX	/* define for Ultrix v3.0 or higher (but not lower) */
  			/* Use BSD for < v3.0 */
  			/* "ULTRIX" not to be confused with "ultrix" */
! #define SYSV		/* define for System V */
  /* #define NETWORK	/* if running on a networked system */
  			/* e.g. Suns sharing a playground through NFS */
  
***************
*** 116,122 ****
  #define tgetch getchar
  #endif
  
! #define SHELL		/* do not delete the '!' command */
  
  #include "system.h"
  
--- 116,122 ----
  #define tgetch getchar
  #endif
  
! /* #define SHELL		/* do not delete the '!' command */
  
  #include "system.h"
  
*** ./include/config.h-	Fri Sep  8 23:12:35 1989
--- ./include/config.h	Fri Sep  8 23:45:45 1989
***************
*** 21,31 ****
  /* #define AMIGA	/* define for Commodore-Amiga */
  /* #define TOS		/* define for Atari 1040ST */
  
! /* #define STUPID	/* avoid some complicated expressions if
  			   your C compiler chokes on them */
  /* #define STUPID_CPP	/* use many small functions instead of macros to
  			   avoid overloading limited preprocessors */
! /* #define TERMINFO	/* uses terminfo rather than termcap */
  			/* should be defined for most, but not all, SYSV */
  			/* in particular, it should NOT be defined for the
  			 * UNIXPC unless you remove the use of the shared
--- 21,31 ----
  /* #define AMIGA	/* define for Commodore-Amiga */
  /* #define TOS		/* define for Atari 1040ST */
  
! #define STUPID	/* avoid some complicated expressions if
  			   your C compiler chokes on them */
  /* #define STUPID_CPP	/* use many small functions instead of macros to
  			   avoid overloading limited preprocessors */
! #define TERMINFO	/* uses terminfo rather than termcap */
  			/* should be defined for most, but not all, SYSV */
  			/* in particular, it should NOT be defined for the
  			 * UNIXPC unless you remove the use of the shared
***************
*** 44,50 ****
   */
  
  #ifndef WIZARD		/* allow for compile-time or Makefile changes */
! #define WIZARD  "izchak" /* the person allowed to use the -D option */
  #endif
  
  #define	LOGFILE	"logfile" /* larger file for debugging purposes */
--- 44,50 ----
   */
  
  #ifndef WIZARD		/* allow for compile-time or Makefile changes */
! #define WIZARD  "games" /* the person allowed to use the -D option */
  #endif
  
  #define	LOGFILE	"logfile" /* larger file for debugging purposes */
***************
*** 57,64 ****
   *	smaller bones/level/save files, but require additional code and time.
   */
  
! #define COMPRESS "/usr/local/compress"
! /* #define ZEROCOMP	/* Use only if COMPRESS is not used -- Olaf Seibert */
  
  
  #define	CHDIR		/* delete if no chdir() available */
--- 57,64 ----
   *	smaller bones/level/save files, but require additional code and time.
   */
  
! /* #define COMPRESS "/usr/local/compress" */
! #define ZEROCOMP	/* Use only if COMPRESS is not used -- Olaf Seibert */
  
  
  #define	CHDIR		/* delete if no chdir() available */
***************
*** 68,74 ****
   * If you define HACKDIR, then this will be the default playground;
   * otherwise it will be the current directory.
   */
! #define HACKDIR	"/usr/games/lib/nethackdir"
  
  /*
   * Some system administrators are stupid enough to make Hack suid root
--- 68,74 ----
   * If you define HACKDIR, then this will be the default playground;
   * otherwise it will be the current directory.
   */
! #define HACKDIR	"/usr/games/lib/nethack3dir"
  
  /*
   * Some system administrators are stupid enough to make Hack suid root
*** ./src/unixmain.c-	Fri Sep  8 23:17:34 1989
--- ./src/unixmain.c	Fri Sep  8 23:29:48 1989
***************
*** 101,106 ****
--- 101,108 ----
  	u.uhp = 1;	/* prevent RIP on early quits */
  	u.ux = FAR;	/* prevent nscr() */
  	(void) signal(SIGHUP, (SIG_RET_TYPE) hangup);
+ 	(void) signal(SIGSEGV, (SIG_RET_TYPE) hangup);
+ 	(void) signal(SIGBUS, (SIG_RET_TYPE) hangup);
  
  	/*
  	 * Find the creation date of this game,
*** ./src/save.c-	Fri Sep  8 23:16:45 1989
--- ./src/save.c	Fri Sep  8 23:29:53 1989
***************
*** 77,82 ****
--- 77,83 ----
  hangup(){
  	hu = TRUE;
  	(void) dosave0();
+ 	settty("Game saved...\n");
  	exit(1);
  	return 0;
  }
*** ./src/Makefile.src-	Mon Aug 28 19:23:22 1989
--- ./src/Makefile.src	Fri Sep  8 23:29:46 1989
***************
*** 10,16 ****
  #	'Sysatt'	-- AT&T UNIXPC, 7300, 3B1
  #	'Systos'	-- Atari
  #	'SysV-AT'	-- Microport 286 UNIX (put -DDUMB in CFLAGS)
! SYSTEM = Sysunix
  
  #
  # Make sure that your bourne shell is specified here, as you have to spawn
--- 10,16 ----
  #	'Sysatt'	-- AT&T UNIXPC, 7300, 3B1
  #	'Systos'	-- Atari
  #	'SysV-AT'	-- Microport 286 UNIX (put -DDUMB in CFLAGS)
! SYSTEM = SysV-AT
  
  #
  # Make sure that your bourne shell is specified here, as you have to spawn
***************
*** 45,52 ****
  # flags for debugging:
  # CFLAGS = -g -I../include
  
! CFLAGS = -O -I../include
! LFLAGS =
  
  # object files for makedefs
  MAKEOBJS = makedefs.o monst.o objects.o panic.o
--- 45,52 ----
  # flags for debugging:
  # CFLAGS = -g -I../include
  
! CFLAGS = -DDUMB -Ml -I../include
! LFLAGS = -Ml
  
  # object files for makedefs
  MAKEOBJS = makedefs.o monst.o objects.o panic.o
***************
*** 64,70 ****
  # Sysatt uses shared library in lieu of this option
  # TERMLIB = -ltermcap
  # TERMLIB = -lcurses
! TERMLIB = -ltermlib
  
  # yacc/lex programs to use to generate lev_comp.c, lev_comp.h, and lev_lex.c.
  # if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
--- 64,70 ----
  # Sysatt uses shared library in lieu of this option
  # TERMLIB = -ltermcap
  # TERMLIB = -lcurses
! TERMLIB = -lcurses
  
  # yacc/lex programs to use to generate lev_comp.c, lev_comp.h, and lev_lex.c.
  # if, instead of yacc/lex you have bison/flex, comment/uncomment the following.
***************
*** 74,80 ****
  # LEX      = flex
  
  # make NetHack
! GAME     = nethack
  
  # if you defined RANDOM in unixconf.h/pcconf.h since your system did not come
  # with a reasonable random number generator -- also remember to get random.c
--- 74,80 ----
  # LEX      = flex
  
  # make NetHack
! GAME     = nethack3
  
  # if you defined RANDOM in unixconf.h/pcconf.h since your system did not come
  # with a reasonable random number generator -- also remember to get random.c
***************
*** 166,172 ****
  
  SysV-AT:	DUMB.Setup $(HOBJ) Makefile
  	@echo "Loading ..."
! 	@$(CC) $(LFLAGS) -o $(GAME) $(HOBJ) $(TERMLIB)
  	@touch SysV-AT
  
  DUMB.Setup:	../include/extern.h
--- 166,172 ----
  
  SysV-AT:	DUMB.Setup $(HOBJ) Makefile
  	@echo "Loading ..."
! 	@$(CC) $(LFLAGS) -o $(GAME) $(HOBJ) $(TERMLIB) -lxmalloc
  	@touch SysV-AT
  
  DUMB.Setup:	../include/extern.h
***************
*** 306,313 ****
  # [Ww]izard, (ii) identifiers may coincide in the first six places:
  # doweararm() versus dowearring().
  # _flsbuf comes from <stdio.h>, a bug in the system libraries.
! 	@echo lint -axbh -DLINT ...
! 	@lint -axbh -I../include -DLINT $(HACKCSRC) $(TARGSRC) | sed '/_flsbuf/d'
  
  
  diff:
--- 306,313 ----
  # [Ww]izard, (ii) identifiers may coincide in the first six places:
  # doweararm() versus dowearring().
  # _flsbuf comes from <stdio.h>, a bug in the system libraries.
! 	@echo lint -DLINT ...
! 	@lint -I../include -DDUMB $(HACKCSRC) $(TARGSRC) | sed '/_flsbuf/d'
  
  
  diff:
*** ./Makefile.top-	Fri Sep  8 23:12:26 1989
--- ./Makefile.top	Fri Sep  8 23:29:54 1989
***************
*** 2,10 ****
  #	SCCS Id: @(#)Makefile.top	3.0	89/03/23
  
  # make NetHack
! GAME     = nethack
  GAMEUID  = games
! GAMEGRP  = bin
  
  # GAMEDIR also appears in config.h as "HACKDIR".
  #
--- 2,10 ----
  #	SCCS Id: @(#)Makefile.top	3.0	89/03/23
  
  # make NetHack
! GAME     = nethack3
  GAMEUID  = games
! GAMEGRP  = games
  
  # GAMEDIR also appears in config.h as "HACKDIR".
  #
***************
*** 15,21 ****
  # instructions)
  GAMEDIR  = /usr/games/lib/$(GAME)dir
  SHELLDIR = /usr/games
! MANDIR   = /usr/man/man6
  MANEXT   = 6
  
  # manual installation for most BSD-style systems
--- 15,21 ----
  # instructions)
  GAMEDIR  = /usr/games/lib/$(GAME)dir
  SHELLDIR = /usr/games
! MANDIR   = /usr/games/man/man6
  MANEXT   = 6
  
  # manual installation for most BSD-style systems