Bug 79933

Summary: Gnibbles exits unexpectedly trying to load level 000
Product: [Retired] Red Hat Linux Reporter: C Duvall <caduvall>
Component: gnome-gamesAssignee: Havoc Pennington <hp>
Status: CLOSED RAWHIDE QA Contact: Jay Turner <jturner>
Severity: low Docs Contact:
Priority: medium    
Version: 7.3CC: srevivo
Target Milestone: ---Keywords: MoveUpstream
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2002-12-19 15:55:36 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Test patch to get rid of level 000 none

Description C Duvall 2002-12-18 03:40:13 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020913

Description of problem:
When playing gnibbles, with the 'levels in random order' option selected,
gnibbles will occasionally exit unexpectedly attempting to load a new level. The
message on the console is:

Ack! Couldn't load level file /usr/share/gnibbles/level000.gnl

It's reproducable consistently when playing many, many games. The levels are in
random order, you know :)

--C

Version-Release number of selected component (if applicable):
gnome-games-1.4.0.1-5

How reproducible:
Sometimes

Steps to Reproduce:
1. Start Gnibbles
2. Choose the levels in random order option
3. Play a couple hundred games
    

Actual Results:  Game exits unexpectedly.

Expected Results:  A new level should be loaded.

Comment 1 Havoc Pennington 2002-12-18 04:31:45 UTC
Hmm, is this an excuse to spend an entire day playing gnibbles? ;-)

Comment 2 C Duvall 2002-12-18 13:18:09 UTC
Created attachment 88794 [details]
Test patch to get rid of level 000

This patch is untested as I haven't figured much out about rpm yet, but it
seems to be the only place where current_level could be set to 0.

Comment 3 Miloslav Trmac 2002-12-18 17:28:45 UTC
-
		tmp = rand () % MAXLEVEL;
+
		tmp = rand () % MAXLEVEL + 1;
This should be
+                       tmp = rand () % (MAXLEVEL - 1) + 1;
Otherwise you remove 0, and add MAXLEVEL


Comment 4 C Duvall 2002-12-18 20:24:16 UTC
MAXLEVEL is defined as 26 in the sources I have, and there is a level for it.
Other places in the source it does rand() % MAXLEVEL + 1, validly. It looks like
valid levels are 1-MAXLEVEL, inclusive.

Comment 5 C Duvall 2002-12-19 15:25:34 UTC
Looking further, this bug seems to be a dup of bug 52900 at bugzilla.gnome.org.
Same trivial patch was submitted as fix by someone else, seems to be fixed now
upstream.

Comment 6 Havoc Pennington 2002-12-19 15:55:36 UTC
Thanks for looking into this. We should have the fix in the next release, then.