Subject: bin/3126: games/gomoku segfaults
To: None <gnats-bugs@gnats.netbsd.org>
From: Andrew Wheadon <andrew@wipux2.wifo.uni-mannheim.de>
List: netbsd-bugs
Date: 01/18/1997 19:14:05
>Number:         3126
>Category:       bin
>Synopsis:       ./gomoku runs out of memory and segfaults
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jan 18 10:20:02 1997
>Last-Modified:
>Originator:     Andrew Wheadon
>Organization:
The cost of living hasn't affected its popularity. (Mark Twain)
current	release=doc host=netbsd.wifo.uni-mannheim.de \ "NetBSD-current mirror"
hostbase=/mit/ftp/pub/NetBSD base=/usr prefix=/usr backup delete use-rel-suffix
>Release:        16.1.97
>Environment:
	
System: NetBSD wipux2.wifo.uni-mannheim.de 1.2B NetBSD 1.2B (WIPOOL) #0: Sat Jan 11 03:34:48 MET 1997 toor@wipux2.wifo.uni-mannheim.de:/src/src/sys/arch/i386/compile/WIPOOL i386


>Description:
When playing gomoku it will usually start using up masses of memory
after about 8 turns (4 each), it will then sit there calculating 
for about 5 minutes before it runs out of memory (if ulimit is set
to 16MB), after which it will segfault. (it failed 4 out of 5 times).
	
>How-To-Repeat:
	play gomoku until it starts thinking for ages and then
	watch it growing with 'top' until it Segfaults.
	
>Fix:
unlimit and add lots of memory to machine or 
free memory after each game (not sufficient since it will often
use up too much memory in one game)
check whether malloc returns NULL and do appropriate action in 
pickmove.c (unluckily appropriate action means more than just "continue;")
or
make it more intelligent or
make the board smaller (not easy either)
or contact author for newer version.
rm -fr gomoku

	
>Audit-Trail:
>Unformatted: