Date: Mon, 27 Oct 2008 13:07:49 -0700 From: Jeremy Chadwick <koitsu@FreeBSD.org> To: clemens fischer <ino-news@spotteswoode.dnsalias.org> Cc: freebsd-questions@freebsd.org Subject: Re: reviving games/freebsd-games Message-ID: <20081027200749.GB29814@icarus.home.lan> In-Reply-To: <ariht5xulu1.ln2@nntp.spotteswoode.dnsalias.org> References: <ariht5xulu1.ln2@nntp.spotteswoode.dnsalias.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Oct 27, 2008 at 08:53:46PM +0100, clemens fischer wrote: > Some of the programs in games/freebsd-games, notably hack and larn, have > the following problem: Given the declarations: > > char *scrollname[] = { char *potionname[] = { > "\0enchant armor", "\0sleep", > "\0enchant weapon", "\0healing", > ... ... > "\0 " "\0 " > }; }; > > (in larn/data.c) the code continues to flag the availability of some > scroll or potion by writing into the first byte of the strings in these > arrays: > > for (i=0; i<MAXSCROLL; i++) scrollname[i][0]=' '; > for (i=0; i<MAXPOTION; i++) potionname[i][0]=' '; > > This leads to SIGSEGV crashes. I think this came about with the gcc-4xx > series of our compiler, but I'm not really sure. I verified that > scrollname and potionname reside in the writable .data segment. The > segv is reproducable. Does anybody know what is wrong with this code? > I assume i could arrange for the flagging to be done in a separate data > structure, but since the programs worked for years this way, I think > there should be an easier way. You've already filed a PR on this? ports/127728. Though that PR encapsulates two or 3 different things, which isn't good. Secondly, there have been complaints about similar issues in the past. http://lists.freebsd.org/pipermail/freebsd-ports/2008-January/046245.html http://lists.freebsd.org/pipermail/freebsd-ports/2008-March/047244.html I think the bottom line here is that until someone steps up and actually volunteers to fix the code, it will remain broken. (I don't normally tote this attitude, but in this case it's applicable: this is a volunteer project! :-) ) -- | Jeremy Chadwick jdc at parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB |
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20081027200749.GB29814>